Build errors when project contains a symlink
See original GitHub issueBug report
Describe the bug
Next commands build
and dev
error out whenever there is a symbolic link in a directory within the project
To Reproduce
Either
- use my example repo https://github.com/acifani/next-symlink-bug
- create a symbolic link (
ln -s source_file dest_file
) in an directory of an existing project
Expected behavior
Build should not error out, whether or not it should follow the symlink I don’t know
Screenshots
Error output:
❯ npm run build
> next-symlink@1.0.0 build /path/to/repo/next-symlink-bug
> next build
> Build error occurred
{ [Error: ENOENT: no such file or directory, stat '/path/to/repo/next-symlink-bug/some_dir/some_symlink']
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path:
'/path/to/repo/next-symlink-bug/some_dir/some_symlink' }
System information
- OS: macOS 10.14.5
- Version of Next.js: ^9
Additional context
The exception is caused by the build checking for possible TypeScript files. More specifically, by fs.statSync
in this line. There’s a separate command, fs.symlinkLink, available for symlinks
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Build fails if the paths contain symlinks : IDEA-202775
I have a build that works in 2018.2.* but consistently fails in 2018.3. The errors start with "package XXX does not exist" for...
Read more >Xcode build fails if build directory involves a symbolic link
In some cases a Xcode project created via cmake does not compile properly if the build directory involves a symbolic link.
Read more >VS project does not load when a symbolic link is in the ...
Visual Studio will show "load failed" on a project when a symbolic link is present in it's Solution Explorer. I excluded the \public...
Read more >What is a "failed to create a symbolic link: file exists" error?
Fool-proof way to create symbolic links. First go into the directory where you want to create the link cd ~/Documents/saga.
Read more >PI53200: ERROR DURING A COPY PROJECT CONTAINING ...
PI53200: ERROR DURING A COPY PROJECT CONTAINING A SYMLINK WITH READ ACCESS ... -Create a new prep project called in this example: crash00...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same appears to happen when I have a symlink to a folder:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.