Next.js Discord

Discord Forum

Symlinks on local dev not working

Unanswered
White-throated Robin posted this in #help-forum
Open in Discord
White-throated RobinOP
Running npm run dev for symlinking something like app/(submodule) on Windows will give a 404 error. Is this a Next.js or webpack issue?

12 Replies

I'm confused?
what do you mean?
symlinking a subroute in next.js.
@averydelusionalperson symlinking a subroute in next.js.
White-throated RobinOP
just symlinking a folder into the app directory
ahh, IDK what that is, never did it, so imma sit this one out.
idk about directly symlinking use the os, but often times npm link is used in these sort of scenarios with a package
if thats not an acceptable solution
you could write a very basic script that just copies the files from the dir you're trying to link to your nextjs codebase everytime the target's files change
@linesofcode you could write a very basic script that just copies the files from the dir you're trying to link to your nextjs codebase everytime the target's files change
White-throated RobinOP
thanks thats roughly what i'm currently doing. just out of curiosity i don't see a reason why symlinks shouldn't work?
No clue sorry, I haven’t used them directly in a while
Always end up using the link functionality via the package manager
White-throated RobinOP
ah i see