Nuxt 3 Deployment issue Build script returned non-zero exit code: 137 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Hello, I have been running into an issue trying to deploy my new Nuxt 3 site. I had been running into several issues with the deploy previously, but was gradually able to step through each one and get further into the build process, and now the logs seem to be throwing several more different errors which I have tried to resolve, but am having a hard time doing so. Any help would be appreciated. I’ve pasted the main error below, along with another copy of the full build log.

The site is bejewelled-cupcake-d05e40

The error seems to be some type of memory issue:
[3855:0x69e8660] 43897 ms: Scavenge 4047.8 (4114.9) β†’ 4047.6 (4126.2) MB, 7.7 / 0.0 ms (average mu = 0.186, current mu = 0.127) allocation failure;
11:05:34 AM: [3855:0x69e8660] 43910 ms: Scavenge 4054.6 (4126.2) β†’ 4055.3 (4126.2) MB, 9.3 / 0.0 ms (average mu = 0.186, current mu = 0.127) allocation failure;
11:05:34 AM: [3855:0x69e8660] 45190 ms: Scavenge 4055.3 (4126.2) β†’ 4054.4 (4148.9) MB, 1280.7 / 0.0 ms (average mu = 0.186, current mu = 0.127) allocation failure;
11:05:34 AM: <β€” JS stacktrace β€”>
11:05:34 AM: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

I’ve already tried setting NODE_OPTIONS=–max-old-space-size=4096 as mentioned elsewhere in the forums related to memory issues.

Any help would be deeply appreciated.

Heres the FULL Build Log:

11:04:50 AM: Netlify Build
11:04:50 AM: ────────────────────────────────────────────────────────────────
11:04:50 AM: ​
11:04:50 AM: ❯ Version
11:04:50 AM: @netlify/build 29.16.0
11:04:50 AM: ​
11:04:50 AM: ❯ Flags
11:04:50 AM: baseRelDir: true
11:04:50 AM: buildId: 64b163e630412d285d828efe
11:04:50 AM: deployId: 64b163e630412d285d828f00
11:04:50 AM: ​
11:04:50 AM: ❯ Current directory
11:04:50 AM: /opt/build/repo
11:04:50 AM: ​
11:04:50 AM: ❯ Config file
11:04:50 AM: No config file was defined: using default values.
11:04:50 AM: ​
11:04:50 AM: ❯ Context
11:04:50 AM: production
11:04:50 AM: ​
11:04:50 AM: Build command from Netlify app
11:04:50 AM: ────────────────────────────────────────────────────────────────
11:04:50 AM: ​
11:04:50 AM: $ npm run build
11:04:51 AM: > build
11:04:51 AM: > nuxt build
11:04:51 AM: [log] Nuxi 3.6.2
11:04:51 AM: [log] Nuxt 3.6.2 with Nitro 2.5.2
11:04:53 AM: [info] Building client…
11:04:53 AM: [info] vite v4.3.9 building for production…
11:04:53 AM: [info] transforming…
11:04:56 AM: [info] βœ“ 600 modules transformed.
11:04:56 AM: [info] rendering chunks…
11:04:57 AM: [info] computing gzip size…
11:04:57 AM: [info] .nuxt/dist/client/_nuxt/Josefin_Sans-400-1.440ea5d9.woff2 4.27 kB
11:04:57 AM: [info] .nuxt/dist/client/_nuxt/Lato-100-4.63aee53d.woff2 5.36 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/components-d357f80c.js 2.44 kB β”‚ map: 1.33 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/IconCSS-291a400d.js 2.56 kB β”‚ map: 2.20 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/index-5ec25ebe.js 2.79 kB β”‚ map: 2.00 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/default-a56366f1.js 2.90 kB β”‚ map: 2.18 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/error-500-d5f5296b.js 3.14 kB β”‚ map: 3.79 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/forms-8c683ca2.js 3.17 kB β”‚ map: 3.20 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/error-404-styles-1.mjs-6ef6e240.js 3.86 kB β”‚ map: 0.12 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/error-404-dde07b7d.js 4.04 kB β”‚ map: 5.83 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/BlogCard-9c7fd052.js 4.07 kB β”‚ map: 2.40 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/baru-245ae243.js 4.18 kB β”‚ map: 3.69 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/pizza-week-7908ab85.js 4.28 kB β”‚ map: 3.80 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/blonk-3c3cf461.js 4.33 kB β”‚ map: 3.84 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/photography-2c3ec64f.js 4.40 kB β”‚ map: 4.48 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/home-starter-9c667d2a.js 4.54 kB β”‚ map: 2.17 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/Icon-270e4f3c.js 4.68 kB β”‚ map: 3.93 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/article-a5575cc6.js 4.88 kB β”‚ map: 5.65 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/branding-c1966785.js 4.94 kB β”‚ map: 6.92 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/new-grid-51f6b9c1.js 5.09 kB β”‚ map: 4.85 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/typography-56460f82.js 5.20 kB β”‚ map: 4.47 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/nuxt-link-563b35af.js 5.99 kB β”‚ map: 13.21 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/about-af673fec.js 7.02 kB β”‚ map: 6.81 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/Footer-de39ccb7.js 10.38 kB β”‚ map: 8.34 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/all-elements-7b2fd3bf.js 15.54 kB β”‚ map: 24.68 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/index-a74ac328.js 16.77 kB β”‚ map: 22.72 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/entry-styles-1.mjs-0f3bd992.js 18.58 kB β”‚ map: 0.11 kB
11:04:58 AM: [info] .nuxt/dist/server/server.mjs 38.97 kB β”‚ map: 91.84 kB
11:04:58 AM: [info] .nuxt/dist/server/_nuxt/entry-styles-2.mjs-2cfecaa9.js 47.06 kB β”‚ map: 0.11 kB
11:04:58 AM: [info] βœ“ built in 1.43s
11:04:58 AM: [success] Server built in 1443ms
11:04:58 AM: [success] [nitro] Generated public dist
11:04:58 AM: [nitro] Nitro now uses isr option to configure ISR behavior on Netlify. Backwards-compatible support for static and swr support with Builder Functions will be removed in the future versions. Set future.nativeSWR: true nitro config disable this warning.
11:04:58 AM: [info] [nitro] Building Nitro Server (preset: netlify)
11:05:01 AM: [success] [nitro] Nitro server built
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/about-af673fec.mjs (7.31 kB) (3.36 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/about-af673fec.mjs.map (1.8 kB) (471 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/all-elements-7b2fd3bf.mjs (15.7 kB) (5.32 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/all-elements-7b2fd3bf.mjs.map (1.49 kB) (576 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/article-a5575cc6.mjs (5.02 kB) (1.49 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/article-a5575cc6.mjs.map (1.35 kB) (562 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Banner-61549d8a.mjs (991 B) (504 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Banner-61549d8a.mjs.map (926 B) (423 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/baru-245ae243.mjs (4.45 kB) (1.59 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/baru-245ae243.mjs.map (2.34 kB) (522 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/blog-7cd70b5d.mjs (2.22 kB) (849 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/blog-7cd70b5d.mjs.map (1.7 kB) (579 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/BlogCard-9c7fd052.mjs (4.07 kB) (1.2 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/BlogCard-9c7fd052.mjs.map (2.91 kB) (871 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/BlogCardVert-a92012e1.mjs (1.16 kB) (591 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/BlogCardVert-a92012e1.mjs.map (805 B) (394 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/blonk-3c3cf461.mjs (4.58 kB) (1.69 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/blonk-3c3cf461.mjs.map (2.34 kB) (522 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/branding-c1966785.mjs (5.17 kB) (1.29 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/branding-c1966785.mjs.map (2.75 kB) (510 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/components-d357f80c.mjs (2.57 kB) (1.02 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/components-d357f80c.mjs.map (1.64 kB) (610 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/config-d8d8a503.mjs (1.76 kB) (731 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/config-d8d8a503.mjs.map (2.16 kB) (731 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/default-a56366f1.mjs (3.07 kB) (1.14 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/default-a56366f1.mjs.map (2.21 kB) (724 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/default-styles.15d0ca4d.mjs (418 B) (238 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/default-styles.15d0ca4d.mjs.map (341 B) (223 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/entry-styles.7bc4b54d.mjs (65.8 kB) (17.4 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/entry-styles.7bc4b54d.mjs.map (5.27 kB) (606 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-dde07b7d.mjs (4.07 kB) (1.72 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-dde07b7d.mjs.map (2.33 kB) (792 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-styles.cf00f4cc.mjs (3.98 kB) (1.25 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-styles.cf00f4cc.mjs.map (348 B) (226 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-d5f5296b.mjs (3.18 kB) (1.42 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-d5f5296b.mjs.map (1.69 kB) (611 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-styles.a001b7ed.mjs (2.28 kB) (869 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-styles.a001b7ed.mjs.map (348 B) (225 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Footer-de39ccb7.mjs (10.4 kB) (1.62 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Footer-de39ccb7.mjs.map (10.8 kB) (822 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/forms-8c683ca2.mjs (3.3 kB) (1.26 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/forms-8c683ca2.mjs.map (1.27 kB) (537 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/header-logo-0fa5d354.mjs (212 B) (175 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/header-logo-0fa5d354.mjs.map (243 B) (188 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/home-starter-9c667d2a.mjs (4.67 kB) (1.28 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/home-starter-9c667d2a.mjs.map (4.17 kB) (881 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Icon-270e4f3c.mjs (4.78 kB) (1.52 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Icon-270e4f3c.mjs.map (4.79 kB) (1.25 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Icon-styles.31d27e7d.mjs (364 B) (217 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/Icon-styles.31d27e7d.mjs.map (332 B) (222 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/IconCSS-291a400d.mjs (2.62 kB) (1.08 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/IconCSS-291a400d.mjs.map (2.49 kB) (823 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/IconCSS-styles.a7b3568b.mjs (573 B) (298 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/IconCSS-styles.a7b3568b.mjs.map (341 B) (227 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/index-5ec25ebe.mjs (2.93 kB) (1.08 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/index-5ec25ebe.mjs.map (2.07 kB) (657 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/index-a74ac328.mjs (17 kB) (3.57 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/index-a74ac328.mjs.map (10.4 kB) (793 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/island-renderer-a50c316c.mjs (1.28 kB) (608 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/island-renderer-a50c316c.mjs.map (909 B) (433 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/new-grid-51f6b9c1.mjs (5.22 kB) (1.05 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/new-grid-51f6b9c1.mjs.map (2.63 kB) (582 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/nuxt-link-563b35af.mjs (6.04 kB) (1.69 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/nuxt-link-563b35af.mjs.map (5.87 kB) (1.45 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/particle-layout-01c5300d.mjs (2.05 kB) (795 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/particle-layout-01c5300d.mjs.map (1.29 kB) (472 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/photography-2c3ec64f.mjs (4.46 kB) (1.28 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/photography-2c3ec64f.mjs.map (2.85 kB) (815 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/photography-styles.0697c157.mjs (652 B) (367 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/photography-styles.0697c157.mjs.map (331 B) (216 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/pizza-week-7908ab85.mjs (4.55 kB) (1.66 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/pizza-week-7908ab85.mjs.map (2.35 kB) (525 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/PortfolioCard-37d190cf.mjs (1.99 kB) (851 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/PortfolioCard-37d190cf.mjs.map (1.81 kB) (683 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/typography-56460f82.mjs (5.34 kB) (1.48 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/_nuxt/typography-56460f82.mjs.map (1.22 kB) (525 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/client.manifest.mjs (43.7 kB) (3.11 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/client.manifest.mjs.map (26 kB) (1.25 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/server.mjs (39.1 kB) (9.91 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/server.mjs.map (46.1 kB) (7.04 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/styles.mjs (985 B) (365 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/app/styles.mjs.map (713 B) (277 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/error-500.mjs (4.26 kB) (1.82 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/error-500.mjs.map (1.06 kB) (392 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/handlers/renderer.mjs (10.4 kB) (3.25 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/handlers/renderer.mjs.map (11.9 kB) (2.37 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/nitro/netlify.mjs (20.2 kB) (5.83 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/nitro/netlify.mjs.map (23.5 kB) (4.15 kB gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/rollup/_virtual_head-static.mjs (301 B) (217 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/rollup/_virtual_head-static.mjs.map (111 B) (112 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/rollup/_virtual_spa-template.mjs (697 B) (449 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/chunks/rollup/_virtual_spa-template.mjs.map (112 B) (112 B gzip)
11:05:01 AM: β”œβ”€ .netlify/functions-internal/server/package.json (3.27 kB) (795 B gzip)
11:05:01 AM: └─ .netlify/functions-internal/server/server.mjs (409 B) (246 B gzip)
11:05:01 AM: Ξ£ Total size: 3.91 MB (987 kB gzip)
11:05:01 AM: ​
11:05:01 AM: (build.command completed in 11s)
11:05:01 AM: ​
11:05:01 AM: Functions bundling
11:05:01 AM: ────────────────────────────────────────────────────────────────
11:05:01 AM: ​
11:05:02 AM: Packaging Functions from .netlify/functions-internal directory:
11:05:02 AM: - server/server.mjs
11:05:02 AM: ​
11:05:34 AM: <β€” Last few GCs β€”>
11:05:34 AM: [3855:0x69e8660] 43897 ms: Scavenge 4047.8 (4114.9) β†’ 4047.6 (4126.2) MB, 7.7 / 0.0 ms (average mu = 0.186, current mu = 0.127) allocation failure;
11:05:34 AM: [3855:0x69e8660] 43910 ms: Scavenge 4054.6 (4126.2) β†’ 4055.3 (4126.2) MB, 9.3 / 0.0 ms (average mu = 0.186, current mu = 0.127) allocation failure;
11:05:34 AM: [3855:0x69e8660] 45190 ms: Scavenge 4055.3 (4126.2) β†’ 4054.4 (4148.9) MB, 1280.7 / 0.0 ms (average mu = 0.186, current mu = 0.127) allocation failure;
11:05:34 AM: <β€” JS stacktrace β€”>
11:05:34 AM: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
11:05:34 AM: 1: 0xb7a940 node::Abort() [/opt/buildhome/node-deps/node]
11:05:34 AM: 2: 0xa8e823 [/opt/buildhome/node-deps/node]
11:05:34 AM: 3: 0xd5c990 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
11:05:34 AM: 4: 0xd5cd37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
11:05:34 AM: 5: 0xf3a435 [/opt/buildhome/node-deps/node]
11:05:34 AM: 6: 0xf4c91d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/buildhome/node-deps/node]
11:05:34 AM: 7: 0xf2701e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/buildhome/node-deps/node]
11:05:34 AM: 8: 0xf283e7 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/buildhome/node-deps/node]
11:05:34 AM: 9: 0xf095ba v8::internal::factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/buildhome/node-deps/node]
11:05:34 AM: 10: 0x12ce7ff v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/buildhome/node-deps/node]
11:05:34 AM: 11: 0x16fb6f9 [/opt/buildhome/node-deps/node]
11:05:43 AM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 137 (Search results for '"non-zero exit code: 137"' - Netlify Support Forums)
11:05:42 AM: /opt/build-bin/build: line 126: 3855 Killed FORCE_COLOR=1 $netlify_build_node_bin $netlify_build_bin --cwd=$repository_root --repositoryRoot=$repository_root --config=$configuration_file_path --branch=$branch --siteId=$site_id --defaultConfig=$default_config --baseRelDir=$base_rel_dir --context=$context --node-path=$user_node_path --cachedConfigPath=$cached_netlify_build_config_file --api-host=$netlify_endpoint --token=$netlify_token --build-id=$BUILD_ID --deploy-id=$DEPLOY_ID --mode=buildbot --telemetry=$build_telemetry --send-status --save-config --statsd.host=$HOST_NODE_IP --statsd.port=$STATSD_PORT --tracing.enabled=$tracing_enabled --tracing.host=$HOST_NODE_IP --tracing.traceId=$trace_id --tracing.parentSpanId=$parent_span_id --tracing.traceFlags=$trace_flags --functions-dist-dir=$functions_dist_dir --edge-functions-dist-dir=$edge_functions_dist_dir --cache-dir=$cache_dir --buildbot-server-socket=$buildbot_server_socket --framework=$framework --feature-flags=$feature_flags --testOpts.silentLingeringProcesses=$SILENT_LINGERING_PROCESSES --system-log-file=$system_log_file --explicit-secret-keys=$explicit_secret_keys
11:05:43 AM: Error running command: Build script returned non-zero exit code: 137
11:05:43 AM: Failing build: Failed to build site
11:05:43 AM: Finished processing build request in 1m30.731s

Hi ,outside of optimsing your build.

Instead of NODE_OPTIONS as an environment variable, can you try setting it directly in your netlify.toml configuration file. Can you try adding:

[build]
  environment = { NODE_OPTIONS="--max-old-space-size=4096" }

Hi SamO, thank you for the help. I created a netlify.toml file with the information you provided, and then added it to the root directory of my project. I am still experiencing the same issue when I try to trigger a deploy. I’m not sure why I’m still encountering the issue. Is it due to some type of timeout on the build process? My project is just a simple portfolio site, nothing too crazy. I typically never have an issue deploying to netlify, but since upgrading this project to Nuxt 3, I’m running into this problem. I’m more of a front end developer, so some of these build errors that happen when I’m trying to deploy to the server are more β€œmysterious” to me. :joy:

Hi SamO,

So I’ve tried a few more things to no avail. Since it seemed to be a memory issue, I tried increasing the memory from:

[build]
environment = { NODE_OPTIONS=β€œβ€“max-old-space-size=4096” }

to:

[build]
environment = { NODE_OPTIONS=β€œβ€“max-old-space-size=8192” }

And also removing some fonts, hoping that would slim things down to see if I could get something/anything to build successfully. It seems to have had some positive affect, as the deploy process seemed to get further along in the build without having a β€œJavaScript Heap out of memory” error.

Below is a copy of the current logs I am receiving. I’m not pasting the entire log, since it’s pretty much the same as the above, this is just the part were things seem to go awry.

Any help would be deeply appreciated!

8:34:06 AM: Ξ£ Total size: 3.87 MB (979 kB gzip)
8:34:06 AM: ​
8:34:06 AM: ❯ Updated config
8:34:06 AM: build:
8:34:06 AM: command: npm run build
8:34:06 AM: commandOrigin: ui
8:34:06 AM: environment:
8:34:06 AM: - DEPRECATED
8:34:06 AM: - NETLIFY_BUILD_DEBUG
8:34:06 AM: - NODE_OPTIONS
8:34:06 AM: publish: /opt/build/repo/dist
8:34:06 AM: publishOrigin: ui
8:34:06 AM: headers:
8:34:06 AM: - for: /_nuxt/*
values:
cache-control: public, max-age=31536000, immutable
redirects:
- from: /__nuxt_error
status: 200
to: /.netlify/functions/server
- from: /*
status: 200
to: /.netlify/functions/server
​
8:34:06 AM: (build.command completed in 11.1s)
8:34:06 AM: Build step duration: build.command completed in 11103ms
8:34:06 AM: ​
8:34:06 AM: Functions bundling
8:34:06 AM: ────────────────────────────────────────────────────────────────
8:34:06 AM: ​
8:34:06 AM: Packaging Functions from .netlify/functions-internal directory:
8:34:06 AM: - server/server.mjs
8:34:06 AM: ​
8:34:40 AM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 137 (Search results for '"non-zero exit code: 137"' - Netlify Support Forums)
8:34:39 AM: /opt/build-bin/build: line 126: 3857 Killed FORCE_COLOR=1 $netlify_build_node_bin $netlify_build_bin --cwd=$repository_root --repositoryRoot=$repository_root --config=$configuration_file_path --branch=$branch --siteId=$site_id --defaultConfig=$default_config --baseRelDir=$base_rel_dir --context=$context --node-path=$user_node_path --cachedConfigPath=$cached_netlify_build_config_file --api-host=$netlify_endpoint --token=$netlify_token --build-id=$BUILD_ID --deploy-id=$DEPLOY_ID --mode=buildbot --telemetry=$build_telemetry --send-status --save-config --statsd.host=$HOST_NODE_IP --statsd.port=$STATSD_PORT --tracing.enabled=$tracing_enabled --tracing.host=$HOST_NODE_IP --tracing.traceId=$trace_id --tracing.parentSpanId=$parent_span_id --tracing.traceFlags=$trace_flags --functions-dist-dir=$functions_dist_dir --edge-functions-dist-dir=$edge_functions_dist_dir --cache-dir=$cache_dir --buildbot-server-socket=$buildbot_server_socket --framework=$framework --feature-flags=$feature_flags --testOpts.silentLingeringProcesses=$SILENT_LINGERING_PROCESSES --system-log-file=$system_log_file --explicit-secret-keys=$explicit_secret_keys
8:34:40 AM: Error running command: Build script returned non-zero exit code: 137
8:34:40 AM: Failing build: Failed to build site
8:34:41 AM: Finished processing build request in 1m21.961s

Hi, @NerdySurfer. A 137 exit code means that the operating system (Linux) killed the process for exceeding the memory limits of the system. In other words, your build command used more memory than was available and the normal operating system response is to terminate the process when this happens.

The possible solutions for this are:

  • upgrade to an Enterprise plan and add the High-Performance Builds add-on to get more memory for the build at Netlify
  • build locally and deploy to Netlify using the CLI tool to make manual deploys
  • modify the build code to use less memory

If there are other questions about this, please let us know.

Your issue sounds identical to one I had, the suggestion in the penultimate comment on this thread fixed it:

I’m having the same issue you are. The only thing that worked for me was downgrading to Nuxt v3.5.3. I’m not even using a CSS preprocessor, just regular CSS files so I didn’t figure that workaround would work for me. It looks like there are 2 issues in Github opened recently that have the same issue.

Hope this helps :pensive:

1 Like

@bksiefert you are a god amongst men. This actually solved my issue after I downgraded Nuxt to v3.5.3. Previously I was using v3.6.5. At first when I downgraded Nuxt to the version you mentioned, my builds were still failing, and I was totally frustrated and still at a loss of hope. However, I quickly then realized that those failures after downgrading to Nuxt 3.5.3 were my own mistake: which was that, previously, as a temporary solution, (since my builds were failing for like a whole 2 months) I was using the SSG build command to generate a static site rather than the true Vue/Nuxt SPA architecture, and the static site gets output to the .output/public folder and not the dist folder. So I had downgraded Nuxt like you mentioned, but forgot to update my build command/deploy settings on Netlify dashboard side of things. Once I downgraded my Nuxt version to v3.5.3 and updated my build settings properly on the Netlify side of things, I was gravy. Thank you so much man! :call_me_hand:t3: :man_surfing:t4:

A few more things I would like to add incase anyone else is experiencing a similar issue: My build failures were a result of multiple issues. Some of the more simple ones I was able to step through relatively quickly, and don’t really recall exactly what they were. The main snag I was encountering seemed to be with the newer Nuxt versions - like 3.6.x & above as @bksiefert mentioned, and also a package(s) I was using that was giving me a hard time, which was β€œtsparticles”: β€œ^2.12.0”,
β€œtsparticles-slim”: β€œ^2.11.0”,
β€œvue3-particles”: β€œ^2.12.0”
However, It seemed to be that it was a combination of those packages + the newer nuxt versions that didn’t play nicely together as I would be able to deploy the site fine but I would have to entirely remove those packages and then deploy the site in SSG mode to be able to have any sort of successful build outcome prior to following @bksiefert’s advice.

I can confirm … reverting to Nuxt 3.5.1 fixed my issues as well.

1 Like

thanks for sharing @bloor