question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build errors when project contains a symlink

See original GitHub issue

Bug 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

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:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
reflashcommented, Jun 18, 2020

Same appears to happen when I have a symlink to a folder:

Error! ENOENT: no such file or directory, stat '/home/runner/work/<projname>/<projname>/<symlink>
0reactions
github-actions[bot]commented, Feb 27, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found