How to debug Next.js app on Vercel when it hangs at the "Linting and checking validity of types" step on npm run build
?
#47455
Replies: 5 comments 9 replies
-
What Node version is your Vercel deployment using? You can see that in the dashboard settings. It looks like it is falling into an infinite loop parsing your files... I've seen something similar with Styled Components and TypeScript, where I managed to create a recursion issue. Though mine crashed out of memory, both locally and on production. Happy to help out. Let's first make sure we have the same environment locally and on Vercel. Could you also check that there's no case sensitivity conflicts? Linux is case sensitive, while MacOS isn't, though that should crash out on not found file, but you never know. |
Beta Was this translation helpful? Give feedback.
-
I cleared out the |
Beta Was this translation helpful? Give feedback.
-
same issue here :/ |
Beta Was this translation helpful? Give feedback.
-
I was having this issue recently, successfully building locally with no linting or type-checking errors, yet it would get stuck at This I was able to finally get it to build by updating my
NOTE: Vercel also successfully built & deployed my project by having just one of them at a time, so that may be another alternative (just make sure that whatever one you're ignoring during the build process, you're checking it locally). For me, I could solo out either one, and they'd both successfully build (4.5min when allowing type checking, 7min when allowing linting)... not sure why they don't work well together. This isn't a super great solution obviously, but you can still do either of these steps locally, or even add it as a little script to do before building locally (which I'm in a habit of building locally before any big code changes anyway), so it works for me. Otherwise, before making this change, one time mine actually PASSED and built on Vercel at literally 44min and 51sec. So, maybe if you upgrade something with Vercel, it will allow for longer builds, and you can keep the More clarity / console.logging about what is actually not working would be great from Vercel, though 🙏 |
Beta Was this translation helpful? Give feedback.
-
[18:30:26.324] Running build in Washington, D.C., USA (East) – iad1 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am getting my
npm run build
hanging here, only on production (at vercel).When I run
npm run build
locally, everything is fine and it builds in less than 1 minute.How can I debug this on Vercel, or reproduce it locally?
How can I inspect and print some verbose info on where the linting / typechecking step is hanging?
Both
npm run build
andnpm run dev
work fine locally, I am able to work on the app, it's just that it's not building on Vercel for some reason, and I don't see any tools to inspect further. I reached out to support a few days ago but haven't heard back.I am on the latest version of Next.js v13.2.4 (I just updated yesterday), and NPM version 8.19.3, and Node.js v18.13.0 locally, on the latest M2 Mac.
I tried git pushing changes several times (triggering new deploys), and also tried redeploying to vercel with the UI button in the admin panel (and bypass the cache), but still same error, it takes 45 minutes and then crashes out.
One thing I will note is that at some point in my project's commit history I committed an 80MB file, but it has since been removed (though I didn't clear the git history of it). Maybe that is causing Vercel to fail for some unforeseen reason? I'm not sure yet and don't know what tools I have to get more details on debugging the linting/typechecking step. Any help would be greatly appreciated.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions