Replies: 14 comments 10 replies
|
I figured out my problem (leaky DB connections) but still do not know how to really debug a next.js build appropriately. Given that code that I wrote is executing (getStaticProps/Paths) at build time it would be super useful to have some docs/tooling to support debugging this process. It is all very opaque right now. |
|
I'm having the same issue atm. Any update on this topic? Any way to reproduce the build environment locally? |
Browserslist: caniuse-lite is outdated. Please run:16:47:58.698 | npx browserslist@latest --update-db It has started coming since February 3, 2022 all of a sudden! I have no avenues to go through! I could only think of the possibility of a bloated package, but i have not used any heavy package as well! |
|
In my case, using wsl2, removing node_modules and reinstall solve this issue. |
|
I face this every time I try to build when the
|
|
I have the same issue with building my React project Module level directives cause errors when bundled, 'use client' was ignored. |
|
Facing tremendous issues with Vercel using Nextjs regarding SIGKILL. My local machine builds in 17 seconds but on Vercel it just does not build and fails with SIGKILL error |
|
The deployment headache with NextJs was so much that i reverted to CRA and
whatever static pages I needed I used svelte.
…On Thu, 2 Nov, 2023, 3:04 pm Prashant Chothani, ***@***.***> wrote:
Facing tremendous issues with Vercel using Nextjs regarding SIGKILL. My
local machine builds in 17 seconds but on Vercel it just does not build and
fails with SIGKILL error
—
Reply to this email directly, view it on GitHub
<#19198 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMETNIHZVEYVLKF4CPZF7I3YCNSJNAVCNFSM4TWN4BUKU5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TONBVGQ2TAMA>
.
You are receiving this because you commented.Message ID: <vercel/next.
***@***.***>
|
|
Here's my log No idea how to debug this. It always works if I redeploy without build cache. |
[nextapp builder 4/4] RUN yarn build:
|
|
Enable build woker and worker threads in the next config file may work in the scenario: |
|
Seeing the same after adding Sentry. Here is an example of a working build log and a failed one. https://gist.github.com/codercatdev/c55e9e7116e382e2310c6ca228d628d3 |
|
I've faced this issues for a week. Finally I've just figure out the reason is because we missed the lock file. I've fixed by delete node_modules and run |
|
Six years on, the question in the title still hasn't been answered, and you said as much yourself back in January 2021. Here's an attempt, because the thing that makes this hard is visible in your very first post and nobody picked it up. Your dmesg line: The kernel killed a node process holding 55 MB. That's not the process that ate your memory. The OOM killer picks by score across the whole cgroup, and in a Two consequences worth stating plainly. A SIGKILL is not a V8 heap error. If you got That also means raising Then there's your "sometimes it passes, sometimes it doesn't". I measured peak memory of the same build three times today, same machine, nothing changed between runs: 216 MB, 334 MB, 450 MB. A single build is not a measurement of anything. If your ceiling sits anywhere near that spread, the build is a coin flip, and it will look like whatever you changed last is what fixed it. That's most of what's in this thread: clearing So, concretely: sample the whole process tree over the build, not one number at the end, and keep the parent and the workers apart. If the workers climb page after page, the useful figure is MB per page and your 739 pages are the multiplier. If it's a single peak while it compiles, page count is irrelevant and no amount of I package that as next-leak: It samples the tree, reports the parent peak and the worker curve separately, and gives MB per page. Node 22+, no For your original case, leaky DB connections in |
Uh oh!
There was an error while loading. Please reload this page.
Background
Running
next buildworks OK locally. It fails however when I run it in a Docker container as part of my production build process. It dies via a SIGKILL during the static assets generation:Through some experimentation (increasing mem allocated to Docker) I can get it to complete. However it requires 8GB! to complete. Currently I have 739 static pages. The number of pages is only going to grow and it surely will not be long before even 8GB is not enough. I also imagine that it will eventually fail locally as well.
Annoying wildcard... Sometimes, but not always, if I run the build again it will succeed.
Things That I Have Already Tried
experimental.cpusflag in mynext.js.configfilemax_old_spaceof V8 viaNODE_OPTIONSI shelled into the container itself and tried just the
yarn buildcommand and it fails in the same way. Runningdmesgin the container confirms that it is an OOM error:Help Needed
I need some guidance on how to debug this issue. I feel like it must be an issue with how I have the project structured and that something is causing a huge increase in mem usage that is out of line with how many static pages that I have. I have never used next.js (or React for that matter) before, so I have no doubt that this is an error I have made. I have already spent many hours on this with no progress.
The project is open-source and can be found here: https://github.com/jeffdc/gallformers
All reactions