[X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
$ node --version
v16.13.1
$ npx next --version
Next.js v12.2.6-canary.8
OS: Ubuntu 22.04
What browser are you using? (if relevant)
CLI
How are you deploying your application? (if relevant)
next build
Describe the Bug
Next.js crashes during build due to out of memory.
The project was building at some point. The recent change which I think of, I've copied ./vendor/drupal/drupal to ./static/drupal/ using copy plugin, so maybe Next.js is trying to scan all those files in static folder and runs out of the memory? If these are static files, why it needs to parse them all? Or maybe it's something else? The project isn't that big, just few files and static files.
Same problem during build in GitHub Actions. Build: 8179674020.
However when running next dev (npm run dev), all seems fine.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
CLI
How are you deploying your application? (if relevant)
next build
Describe the Bug
Next.js crashes during build due to out of memory. The project was building at some point. The recent change which I think of, I've copied
./vendor/drupal/drupal
to./static/drupal/
using copy plugin, so maybe Next.js is trying to scan all those files in static folder and runs out of the memory? If these are static files, why it needs to parse them all? Or maybe it's something else? The project isn't that big, just few files and static files.Same problem during build in GitHub Actions. Build: 8179674020.
However when running
next dev
(npm run dev
), all seems fine.Similar issues:
Expected Behavior
Next.js shouldn't crash during build.
Link to reproduction
https://github.com/mycognitive/Drupal7-demo/tree/nextjs-gh-32314
To Reproduce
Repro steps with project using Drupal in wasm:
Increasing to 10GB or more doesn't help either.
Stack trace