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.

ENOENT build error with Vercel + pnpm

See original GitHub issue

What 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:

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

github_iconTop GitHub Comments

2reactions
elliottsjcommented, Jan 11, 2021

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

0reactions
balazsorban44commented, Jan 28, 2022

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.

Read more comments on GitHub >

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

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