Open juanlarrambebere opened 1 year ago
When this happens the build gets stuck at
info Linting and checking validity of types
instead of failing.
This is very unfortunate as that step only runs ESLint and TypeScript. If they're the bottleneck then we have little things to do there.
Running into same issue on a M1 mac. I believe this is linked to the arm64 architecture. Haven't found a solution yet.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/juanlarrambebere/nextjs-memory-issue
To Reproduce
Create a nextjs app with typescript
npx create-next-app@latest
Reduce Node memory allocation to a minimum (128mb) or less
export NODE_OPTIONS=--max-old-space-size=128
Build the app
npm run build
Describe the Bug
Building the app gets stuck if the process runs of memory.
Sometimes when building the app the memory required by nodejs exceeds its memory allocation capacity (1.5gb since nodejs 12). When this happens the build gets stuck at
info Linting and checking validity of types
instead of failing. This is particularly bad in the CI environment because actions gets stuck or even worse, the step gets marked as successful when it should be marked as error.In the reproduction steps I drastically reduced nodejs's memory allocation capacity to a bear minimum so we can realiably reproduce it with an "empty" nextjs application, though if the app is big enough, the actual limit (1.5gb) might be reached.
Expected Behavior
If the process runs out of memory the build should fail instead of getting stuck.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response