ENOENT build error with Vercel + pnpm
See original GitHub issueWhat version of Next.js are you using?
10.0.5
What version of Node.js are you using?
14.15.3
What browser are you using?
Edge (Chromium)
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
Context:
- https://github.com/vercel/next.js/issues/16471#issuecomment-736095201
- https://github.com/vercel/vercel/discussions/3896#discussioncomment-131265
- https://github.com/elliottsj/nextjs-vercel-pnpm-issue
As discussed above and described by @vasiliicuhar here, the latest Next.js does not build on Vercel when using pnpm, due to:
Error: ENOENT: no such file or directory, lstat '/vercel/workpath0/app/url'
--
15:28:10.448 | at realpathSync (fs.js:1643:7)
15:28:10.448 | at handleExternals (/vercel/workpath0/app/node_modules/.pnpm/next@10.0.5_react-dom@17.0.1+react@17.0.1/node_modules/next/dist/build/webpack-config.js:66:21)
Expected Behavior
The error above should not occur, and the project should build successfully.
To Reproduce
A full reproduction is described here: https://github.com/elliottsj/nextjs-vercel-pnpm-issue
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to fix Next.js Vercel deployment module not found error
My next.js app works on my machine and was working when deployed on Vercel but now it fails when building on Vercel with...
Read more >Deploying sveltekit app on vercel, problems (fetching ... - Reddit
This is the full error that I'm getting. I have added the database URL as an environment variable in the Vercel project, so...
Read more >The command npm run build exited with code 1 vue
0 build: `ng build` npm ERR! spawn ENOENT npm ERR! npm ERR! ... Build Failed Command "npm run build" exited with 1 in...
Read more >rushstack/rushstack - Gitter
Whereas if you run heft build , then it writes everything to disk in the dist ... + pnpm issues, it looks like...
Read more >ENOENT: no such file or directory when deployed to Vercel
As I said the site ran fine locally, I also ran a npm run build locally to ensure that ... ERROR Error: ENOENT:...
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 Free
Top 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
Looks like this is fixed as of v10.0.6-canary.0 🎉
Successful build after upgrading: https://github.com/elliottsj/nextjs-vercel-pnpm-issue/commit/1474b6fe9fc7bc05e3fe7ce8a0dabb0ae3d57289
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.