How are you deploying your application? (if relevant)
yarn start
Describe the Bug
next dev throws an error when the .next and node_modules folders are located via symbolic links on drives different from main project drive. The error message is:
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - SWC minify release candidate enabled. https://nextjs.link/swcmin
error - Module not found: Error: Can't resolve './D:/TMP/_coding-important/03-open-jira/node_modules/next/dist/client/dev/amp-dev' in 'C:\Users\Stefano\Dropbox\Documents\Coding\_Work\Magenta Innova\Capacitación\Next\03-open-jira'
.next and node_modules are symbolic links whose location are set via:
However, when targets to symbolic links are located on same drive as project, there are no issues:
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - SWC minify release candidate enabled. https://nextjs.link/swcmin
event - compiled client and server successfully in 10.4s (1098 modules)
Expected nextjs to run symbolic links correctly regardless of target (drive)location.
Such as when links point to target on same drive as project.
Link to reproduction
The glitch is not code related. Can be reproduced with any repo.
To Reproduce
Remove or move .next and node_modules folder from project directory.
If removed, create new folders where "real" files will be located. If moved, ignore. "Real" folders must be located on a different drive from drive where the project is located.
Create Symbolic links in project directory targeting "real" folders.
This bit me as well when trying to self host a nextjs app on k8s and attempted to symlink .next folder to a shared drive. Any pointers on where to start from on trying to contribute a PR?
Verify canary release
Provide environment information
Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Binaries: Node: 16.16.0 npm: N/A Yarn: N/A pnpm: N/A Relevant packages: next: 12.2.6-canary.0 eslint-config-next: 12.2.5 react: 18.2.0 react-dom: 18.2.0
What browser are you using? (if relevant)
Vivaldi
How are you deploying your application? (if relevant)
yarn start
Describe the Bug
next dev
throws an error when the.next
andnode_modules
folders are located via symbolic links on drives different from main project drive. The error message is:.next
andnode_modules
are symbolic links whose location are set via:However, when targets to symbolic links are located on same drive as project, there are no issues:
Symbolic links are located as following:
Expected Behavior
Expected nextjs to run symbolic links correctly regardless of target (drive)location. Such as when links point to target on same drive as project.
Link to reproduction
The glitch is not code related. Can be reproduced with any repo.
To Reproduce
.next
andnode_modules
folder from project directory.Example:
npm install
(no issues should arise here, node_modules is known to run well via symbolic links)next dev
and watch for error in terminal.