JavaScript heap out of memory when trying to build a Nuxt app

Hi there,

So I’ve recently built and launched a Nuxt 3 website called Laravel Package Ocean which is also open source.

Just few days ago I tried to update one of the npm dependencies to a newer version, and I noticed my Deploy Builds are failing. The package is @fontsource/poppins and the working version is ^4.5.10 while the version that breaks the Netlify build and causes the out of memory error is ^5.0.0 and above.

I’ve talked to the maintainer of the package here and they said it’s mostly like a Netlify issue.

Site name on Netlify: laravel-package-ocean.netlify.app

Here is my build settings screenshot:

Here is the failing build log:

12:45:59 PM: build-image version: 4b067841aaa59ef71931d3505b98c2bc3e63f36f (focal)
12:45:59 PM: buildbot version: a97756545adbd82de83b06c902122c919d70e7f2
12:45:59 PM: Building without cache
12:45:59 PM: Starting to prepare the repo for build
12:45:59 PM: No cached dependencies found. Cloning fresh repo
12:45:59 PM: git clone --filter=blob:none https://github.com/HassanZahirnia/laravel-package-ocean
12:45:59 PM: Preparing Git Reference refs/heads/main
12:46:01 PM: Starting to install dependencies
12:46:01 PM: Python version set to 3.8
12:46:01 PM: Attempting Ruby version 2.7.2, read from environment
12:46:02 PM: Using Ruby version 2.7.2
12:46:02 PM: Started restoring cached go cache
12:46:02 PM: Finished restoring cached go cache
12:46:04 PM: go version go1.19.9 linux/amd64
12:46:04 PM: Using PHP version 8.0
12:46:05 PM: Attempting Node.js version '18.13.0' from .node-version
12:46:05 PM: Downloading and installing node v18.13.0...
12:46:05 PM: Downloading https://nodejs.org/dist/v18.13.0/node-v18.13.0-linux-x64.tar.xz...
12:46:05 PM: Computing checksum with sha256sum
12:46:05 PM: Checksums matched!
12:46:07 PM: Now using node v18.13.0 (npm v8.19.3)
12:46:08 PM: Enabling Node.js Corepack
12:46:08 PM: Started restoring cached build plugins
12:46:08 PM: Finished restoring cached build plugins
12:46:08 PM: Started restoring cached corepack dependencies
12:46:08 PM: Finished restoring cached corepack dependencies
12:46:08 PM: Found pnpm version (7.13.4) that doesn't match expected ()
Usage Error: Invalid package manager specification in CLI arguments; expected a semver version, range, or tag
12:46:08 PM: $ corepack prepare [--activate] [--all] [--json] [-o,--output] ...
12:46:08 PM: No pnpm workspaces detected
12:46:08 PM: Started restoring cached node modules
12:46:08 PM: Finished restoring cached node modules
12:46:08 PM: Installing npm packages using pnpm version 7.13.4
12:46:09 PM:  WARN  Ignoring not compatible lockfile at /opt/build/repo/pnpm-lock.yaml
12:46:09 PM: Progress: resolved 1, reused 0, downloaded 0, added 0
12:46:10 PM: Progress: resolved 28, reused 0, downloaded 13, added 0
12:46:11 PM: Progress: resolved 58, reused 0, downloaded 39, added 0
12:46:12 PM: Progress: resolved 94, reused 0, downloaded 81, added 0
12:46:13 PM: Progress: resolved 205, reused 0, downloaded 185, added 0
12:46:14 PM: Progress: resolved 301, reused 0, downloaded 276, added 0
12:46:15 PM: Progress: resolved 414, reused 0, downloaded 385, added 0
12:46:16 PM: Progress: resolved 536, reused 0, downloaded 486, added 0
12:46:17 PM: Progress: resolved 726, reused 0, downloaded 650, added 0
12:46:17 PM:  WARN  deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
12:46:18 PM: Progress: resolved 932, reused 0, downloaded 840, added 0
12:46:18 PM: Packages: +923
12:46:18 PM: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12:46:18 PM: Packages are hard linked from the content-addressable store to the virtual store.
12:46:18 PM:   Content-addressable store is at: /opt/build/.pnpm-store/v3
12:46:18 PM:   Virtual store is at:             node_modules/.pnpm
12:46:19 PM: Progress: resolved 941, reused 0, downloaded 919, added 336
12:46:19 PM: .../node_modules/vue-demi postinstall$ node ./scripts/postinstall.js
12:46:19 PM: .../node_modules/vue-demi postinstall: Done
12:46:19 PM: .../esbuild@0.17.19/node_modules/esbuild postinstall$ node install.js
12:46:19 PM: .../esbuild@0.17.19/node_modules/esbuild postinstall: Done
12:46:19 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install$ node-pre-gyp install --fallback-to-build
12:46:19 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp info it worked if it ends with ok
12:46:19 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp info using node-pre-gyp@1.0.10
12:46:19 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp info using node@18.13.0 | linux | x64
12:46:19 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp info check checked for "/opt/build/repo/node_modules/.pnpm/sqlite3@5.1.6/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node" (not found)
12:46:19 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp http GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.6/napi-v6-linux-glibc-x64.tar.gz
12:46:20 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp info install unpacking napi-v6-linux-glibc-x64/node_sqlite3.node
12:46:20 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp info extracted file count: 1
12:46:20 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: node-pre-gyp info ok
12:46:20 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: [sqlite3] Success: "/opt/build/repo/node_modules/.pnpm/sqlite3@5.1.6/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.node" is installed via remote
12:46:20 PM: .../sqlite3@5.1.6/node_modules/sqlite3 install: Done
12:46:20 PM: Progress: resolved 941, reused 0, downloaded 919, added 923, done
12:46:21 PM: > @ postinstall /opt/build/repo
12:46:21 PM: > nuxt prepare
12:46:21 PM: [log] Nuxi 3.5.1
12:46:22 PM: [success] Types generated in .nuxt
12:46:22 PM: devDependencies:
12:46:22 PM: + @fontsource/poppins 5.0.1
12:46:22 PM: + @formkit/auto-animate 1.0.0-beta.6
12:46:22 PM: + @headlessui/vue 1.7.13
12:46:22 PM: + @iconify-json/bi 1.1.16
12:46:22 PM: + @iconify-json/carbon 1.1.16
12:46:22 PM: + @iconify-json/fluent-emoji 1.1.13
12:46:22 PM: + @iconify-json/fluent-emoji-flat 1.1.11
12:46:22 PM: + @iconify-json/logos 1.1.31
12:46:22 PM: + @iconify-json/ph 1.1.5
12:46:22 PM: + @iconify/utils 2.1.5
12:46:22 PM: + @nuxtjs/color-mode 3.2.0
12:46:22 PM: + @tailwindcss/forms 0.5.3
12:46:22 PM: + @types/gradient-string 1.1.2
12:46:22 PM: + @types/inquirer 9.0.3
12:46:22 PM: + @types/inquirer-autocomplete-prompt 3.0.0
12:46:22 PM: + @types/lodash 4.14.195
12:46:22 PM: + @types/node 20.2.4
12:46:22 PM: + @types/ua-parser-js 0.7.36
12:46:22 PM: + @typescript-eslint/eslint-plugin 5.59.7
12:46:22 PM: + @typescript-eslint/parser 5.59.7
12:46:22 PM: + @unocss/nuxt 0.52.3
12:46:22 PM: + @unocss/preset-icons 0.52.3
12:46:22 PM: + @vueuse/core 10.1.2
12:46:22 PM: + @vueuse/nuxt 10.1.2
12:46:22 PM: + autoprefixer 10.4.14
12:46:22 PM: + axios 1.4.0
12:46:22 PM: + chalk 5.2.0
12:46:22 PM: + dayjs 1.11.7
12:46:22 PM: + dotenv 16.0.3
12:46:22 PM: + eslint 8.41.0
12:46:22 PM: + eslint-plugin-import 2.27.5
12:46:22 PM: + eslint-plugin-import-newlines 1.3.1
12:46:22 PM: + eslint-plugin-jsonc 2.8.0
12:46:22 PM: + eslint-plugin-unicorn 47.0.0
12:46:22 PM: + eslint-plugin-vue 9.14.1
12:46:22 PM: + fuse.js 6.6.2
12:46:22 PM: + gradient-string 2.0.2
12:46:22 PM: + gsap 3.11.5
12:46:22 PM: + inquirer 9.2.6
12:46:22 PM: + inquirer-autocomplete-prompt 3.0.0
12:46:22 PM: + jsonc-eslint-parser 2.3.0
12:46:22 PM: + lodash 4.17.21
12:46:22 PM: + minisearch 6.1.0
12:46:22 PM: + nuxt 3.5.1
12:46:22 PM: + nuxt-gtag 0.5.7
12:46:22 PM: + nuxt-simple-sitemap 2.6.1
12:46:22 PM: + ora 6.3.1
12:46:22 PM: + postcss 8.4.23
12:46:22 PM: + semver 7.5.1
12:46:22 PM: + sqlite3 5.1.6
12:46:22 PM: + stylus 0.59.0
12:46:22 PM: + tailwindcss 3.3.2
12:46:22 PM: + tippy.js 6.3.7
12:46:22 PM: + tsx 3.12.7
12:46:22 PM: + typescript 5.0.4
12:46:22 PM: + ua-parser-js 1.0.35
12:46:22 PM: + vue 3.3.4
12:46:22 PM: + zod 3.21.4
12:46:22 PM: Done in 13.6s
12:46:22 PM: npm packages installed using pnpm
12:46:22 PM: Install dependencies script success
12:46:22 PM: Starting build script
12:46:23 PM: Detected 1 framework(s)
12:46:23 PM: "nuxt" at version "3.5.1"
12:46:23 PM: Section completed: initializing
12:46:24 PM: ​
12:46:24 PM: Netlify Build                                                 
12:46:24 PM: ────────────────────────────────────────────────────────────────
12:46:24 PM: ​
12:46:24 PM: ❯ Version
12:46:24 PM:   @netlify/build 29.11.6
12:46:24 PM: ​
12:46:24 PM: ❯ Flags
12:46:24 PM:   baseRelDir: true
12:46:24 PM:   buildId: 647078cb8a01f46c799f3ce8
12:46:24 PM:   deployId: 647078cb8a01f46c799f3cea
12:46:24 PM: ​
12:46:24 PM: ❯ Current directory
12:46:24 PM:   /opt/build/repo
12:46:24 PM: ​
12:46:24 PM: ❯ Config file
12:46:24 PM:   No config file was defined: using default values.
12:46:24 PM: ​
12:46:24 PM: ❯ Context
12:46:24 PM:   production
12:46:24 PM: ​
12:46:24 PM: Build command from Netlify app                                
12:46:24 PM: ────────────────────────────────────────────────────────────────
12:46:24 PM: ​
12:46:24 PM: $ pnpm run build --max-old-space-size=4096
12:46:25 PM: > @ build /opt/build/repo
12:46:25 PM: > nuxt build "--max-old-space-size=4096"
12:46:25 PM: [log] Nuxi 3.5.1
12:46:25 PM: [log] Nuxt 3.5.1 with Nitro 2.4.1
12:46:26 PM: [info] Building client...
12:46:26 PM: [info] vite v4.3.8 building for production...
12:46:27 PM: [info] transforming...
12:46:31 PM: [info] ✓ 413 modules transformed.
12:46:31 PM: [info] rendering chunks...
12:46:32 PM: [info] computing gzip size...
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/sad.daa322c5.webp                          6.74 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/excited.18cb0fd0.webp                      7.33 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-100-normal.a9220f99.woff2    7.48 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-900-normal.17ea1019.woff2    7.63 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-500-normal.cd36de20.woff2    7.75 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-700-normal.9338e65f.woff2    7.82 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-800-normal.60bf0aba.woff2    7.82 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-300-normal.78bc3aa7.woff2    7.84 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-400-normal.7d93459d.woff2    7.88 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-200-normal.6f0c5725.woff2    7.93 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-600-normal.f4e80d9d.woff2    8.00 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-100-normal.d1eda978.woff    10.04 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-900-normal.940cfac0.woff    10.18 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-500-normal.6f35fc59.woff    10.37 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-700-normal.630ac4e1.woff    10.43 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-800-normal.993bd790.woff    10.43 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-300-normal.78a4e0ac.woff    10.50 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-200-normal.07512a37.woff    10.52 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-400-normal.2db0a254.woff    10.53 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/poppins-latin-600-normal.90ae1c77.woff    10.60 kB
12:46:32 PM: [info] .nuxt/dist/client/manifest.json                                   12.60 kB │ gzip:   1.33 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/emerald-blur.6caa5bca.webp                18.50 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/pink-blur.27462087.webp                   20.87 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/pink-blur-dark.a7188788.webp              24.11 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/fluid-shape.a1490bd9.webp                 25.03 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/blue-blur.ae6790fb.webp                   25.47 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/blue-blur-dark.80378a72.webp              25.69 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/error-500.26873dcc.css                     1.95 kB │ gzip:   0.74 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/error-404.dd29d79a.css                     3.63 kB │ gzip:   1.12 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/index.5c61d894.css                         9.17 kB │ gzip:   1.21 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/default.90fd4ea0.css                      51.67 kB │ gzip:   9.50 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/entry.da366d9d.css                        99.78 kB │ gzip:  21.79 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/_plugin-vue_export-helper.c27b6911.js      0.09 kB │ gzip:   0.10 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/error-component.b8c50915.js                1.23 kB │ gzip:   0.65 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/error-500.6406f4dc.js                      1.93 kB │ gzip:   1.02 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/error-404.28a1401c.js                      2.31 kB │ gzip:   1.20 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/nuxt-link.d5d9cc31.js                      4.33 kB │ gzip:   1.84 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/default.3119ba4d.js                       39.06 kB │ gzip:  14.21 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/client-only.ffc21e86.js                   78.29 kB │ gzip:  31.06 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/entry.c98ff100.js                        150.94 kB │ gzip:  57.26 kB
12:46:32 PM: [info] .nuxt/dist/client/_nuxt/index.c4123195.js                        466.49 kB │ gzip: 137.76 kB
12:46:32 PM: [info] ✓ built in 5.90s
12:46:32 PM: [success] Client built in 5912ms
12:46:32 PM: [info] Building server...
12:46:32 PM: [info] vite v4.3.8 building SSR bundle for production...
12:46:32 PM: [info] transforming...
12:46:34 PM: [info] ✓ 109 modules transformed.
12:46:34 PM: [info] rendering chunks...
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/unocss-styles.6ca9f726.mjs               0.08 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/packages-styles.d250defe.mjs             0.08 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-404-styles.80478c74.mjs            0.08 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-500-styles.2483f26f.mjs            0.08 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/default.vue.58b01e83.vue                 0.13 kB
12:46:34 PM: [info] .nuxt/dist/server/styles.mjs                                     0.81 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/unocss-styles-1.mjs-79390a7c.js          0.13 kB │ map:  0.11 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/_plugin-vue_export-helper-cc2b3d55.js    0.25 kB │ map:  0.13 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/packages-styles-1.mjs-c48d8fe2.js        0.38 kB │ map:  0.12 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/client-only-18f4f110.js                  1.13 kB │ map:  3.52 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/island-renderer-fdd4dd4a.js              1.16 kB │ map:  1.45 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-component-3ac95767.js              2.10 kB │ map:  2.76 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-500-styles-1.mjs-495e79e6.js       2.17 kB │ map:  0.12 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-dev-styles-1.mjs-8c89367e.js       2.46 kB │ map:  0.12 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/default.vue-4e2ec740.js                  2.70 kB │ map:  0.11 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-500-7a8fe706.js                    3.23 kB │ map:  3.83 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-404-styles-1.mjs-dae82ae2.js       3.86 kB │ map:  0.12 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/error-404-af606d71.js                    4.12 kB │ map:  5.87 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/nuxt-link-0d39ff03.js                    5.97 kB │ map: 13.24 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/default-89fbae99.js                     33.71 kB │ map: 22.24 kB
12:46:34 PM: [info] .nuxt/dist/server/server.mjs                                    35.59 kB │ map: 88.68 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/default.vue-350f204f.js                 51.11 kB │ map:  0.11 kB
12:46:34 PM: [info] .nuxt/dist/server/_nuxt/index-2e368fa9.js                      236.07 kB │ map: 21.69 kB
12:46:34 PM: [info] ✓ built in 1.37s
12:46:34 PM: [success] Server built in 1379ms
12:46:34 PM: [success] [nitro] Generated public dist
12:46:34 PM: [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.
12:46:34 PM: [log] [nitro]   ├─ /__sitemap__/routes.json (0ms)
12:46:34 PM: [info] [nitro] Building Nitro Server (preset: `netlify`)
12:46:39 PM: [success] [nitro] Nitro server built
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/_plugin-vue_export-helper-cc2b3d55.mjs (254 B) (200 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/_plugin-vue_export-helper-cc2b3d55.mjs.map (447 B) (266 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/client-only-18f4f110.mjs (1.06 kB) (534 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/client-only-18f4f110.mjs.map (1.08 kB) (473 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/default-89fbae99.mjs (60.5 kB) (13.1 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/default-89fbae99.mjs.map (45.3 kB) (6.47 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/default.vue.58b01e83.mjs (54.2 kB) (9.87 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/default.vue.58b01e83.mjs.map (1.1 kB) (324 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-af606d71.mjs (4.19 kB) (1.78 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-af606d71.mjs.map (2.32 kB) (777 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-styles.80478c74.mjs (3.92 kB) (1.25 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-404-styles.80478c74.mjs.map (326 B) (214 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-7a8fe706.mjs (3.29 kB) (1.47 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-7a8fe706.mjs.map (1.68 kB) (605 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-styles.2483f26f.mjs (2.22 kB) (861 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-500-styles.2483f26f.mjs.map (326 B) (214 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-component-3ac95767.mjs (2.13 kB) (940 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/error-component-3ac95767.mjs.map (2.38 kB) (805 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/index-2e368fa9.mjs (236 kB) (39.6 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/index-2e368fa9.mjs.map (162 kB) (6.64 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/island-renderer-fdd4dd4a.mjs (1.29 kB) (612 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/island-renderer-fdd4dd4a.mjs.map (909 B) (431 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/nuxt-link-0d39ff03.mjs (5.98 kB) (1.66 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/nuxt-link-0d39ff03.mjs.map (5.86 kB) (1.45 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/packages-styles.d250defe.mjs (435 B) (255 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/packages-styles.d250defe.mjs.map (322 B) (214 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/unocss-styles.6ca9f726.mjs (182 B) (154 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/_nuxt/unocss-styles.6ca9f726.mjs.map (312 B) (207 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/client.manifest.mjs (18.8 kB) (1.76 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/client.manifest.mjs.map (10.5 kB) (977 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/server.mjs (35.7 kB) (9.69 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/server.mjs.map (41 kB) (6.76 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/styles.mjs (875 B) (381 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/app/styles.mjs.map (573 B) (255 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/error-500.mjs (4.26 kB) (1.82 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/error-500.mjs.map (1.11 kB) (410 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/handlers/renderer.mjs (9.64 kB) (3.06 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/handlers/renderer.mjs.map (11.2 kB) (2.31 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/nitro/netlify.mjs (37.9 kB) (10.8 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/nitro/netlify.mjs.map (38.5 kB) (6.3 kB gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/rollup/_virtual_head-static.mjs (1.31 kB) (618 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/chunks/rollup/_virtual_head-static.mjs.map (111 B) (112 B gzip)
12:46:40 PM:   ├─ .netlify/functions-internal/server/package.json (3.28 kB) (1.17 kB gzip)
12:46:40 PM:   └─ .netlify/functions-internal/server/server.mjs (409 B) (246 B gzip)
12:46:40 PM: Σ Total size: 7.08 MB (1.68 MB gzip)
12:46:40 PM: [log] [nitro]   ├─ /__sitemap__/routes.json (0ms)
12:46:40 PM: ​
12:46:40 PM: (build.command completed in 15.3s)
12:46:40 PM: ​
12:46:40 PM: Functions bundling                                            
12:46:40 PM: ────────────────────────────────────────────────────────────────
12:46:40 PM: ​
12:46:40 PM: Packaging Functions from .netlify/functions-internal directory:
12:46:40 PM:  - server/server.mjs
12:46:40 PM: ​
12:46:43 PM: <--- Last few GCs --->
12:46:43 PM: [3522:0x5b05460]    19864 ms: Mark-sweep (reduce) 227.6 (274.3) -> 227.5 (241.8) MB, 33.1 / 0.0 ms  (average mu = 0.889, current mu = 0.169) last resort GC in old space requested
12:46:43 PM: [3522:0x5b05460]    19898 ms: Mark-sweep (reduce) 227.5 (241.8) -> 227.5 (241.1) MB, 34.6 / 0.0 ms  (average mu = 0.785, current mu = 0.000) last resort GC in old space requested
12:46:43 PM: <--- JS stacktrace --->
12:46:43 PM: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
12:46:43 PM:  1: 0xb090e0 node::Abort() [/opt/buildhome/node-deps/node]
12:46:43 PM:  2: 0xa1b70e  [/opt/buildhome/node-deps/node]
12:46:43 PM:  3: 0xce19d0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
12:46:43 PM:  4: 0xce1d77 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
12:46:43 PM:  5: 0xe993e5  [/opt/buildhome/node-deps/node]
12:46:43 PM:  6: 0xeabe58 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/buildhome/node-deps/node]
12:46:43 PM:  7: 0xe79bb6 v8::internal::Factory::CodeBuilder::AllocateCode(bool) [/opt/buildhome/node-deps/node]
12:46:43 PM:  8: 0xe7a215 v8::internal::Factory::CodeBuilder::BuildInternal(bool) [/opt/buildhome/node-deps/node]
12:46:43 PM:  9: 0xe7ac2e v8::internal::Factory::CodeBuilder::Build() [/opt/buildhome/node-deps/node]
12:46:43 PM: 10: 0x14c8d8e v8::internal::RegExpMacroAssemblerX64::GetCode(v8::internal::Handle<v8::internal::String>) [/opt/buildhome/node-deps/node]
12:46:43 PM: 11: 0x11b45b9 v8::internal::RegExpCompiler::Assemble(v8::internal::Isolate*, v8::internal::RegExpMacroAssembler*, v8::internal::RegExpNode*, int, v8::internal::Handle<v8::internal::String>) [/opt/buildhome/node-deps/node]
12:46:43 PM: 12: 0x11d2947 v8::internal::RegExpImpl::Compile(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::RegExpCompileData*, v8::base::Flags<v8::internal::JSRegExp::Flag, int>, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>, bool, unsigned int&) [/opt/buildhome/node-deps/node]
12:46:43 PM: 13: 0x11d30f0 v8::internal::RegExpImpl::CompileIrregexp(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>, bool) [/opt/buildhome/node-deps/node]
12:46:43 PM: 14: 0x11d3cee v8::internal::RegExpImpl::IrregexpPrepare(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>) [/opt/buildhome/node-deps/node]
12:46:43 PM: 15: 0x11d3e67 v8::internal::RegExpImpl::IrregexpExec(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>, int, v8::internal::Handle<v8::internal::RegExpMatchInfo>, v8::internal::RegExp::ExecQuirks) [/opt/buildhome/node-deps/node]
12:46:43 PM: 16: 0x11f9038 v8::internal::Runtime_RegExpExec(int, unsigned long*, v8::internal::Isolate*) [/opt/buildhome/node-deps/node]
12:46:43 PM: 17: 0x15d9e19  [/opt/buildhome/node-deps/node]
12:46:43 PM: /opt/build-bin/build: line 113:  3522 Aborted                 (core dumped) FORCE_COLOR=1 "$netlify_build_node_bin" "$netlify_build_bin" --cwd="$repository_root" --repositoryRoot="$repository_root" --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="$DATADOG_HOST" --statsd.port="$STATSD_PORT" --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"
12:46:43 PM: Caching artifacts
12:46:43 PM: Started saving node modules
12:46:43 PM: Finished saving node modules
12:46:43 PM: Started saving build plugins
12:46:43 PM: Finished saving build plugins
12:46:43 PM: Started saving corepack cache
12:46:43 PM: Finished saving corepack cache
12:46:43 PM: Started saving pip cache
12:46:43 PM: Finished saving pip cache
12:46:43 PM: Started saving emacs cask dependencies
12:46:43 PM: Finished saving emacs cask dependencies
12:46:43 PM: Started saving maven dependencies
12:46:43 PM: Finished saving maven dependencies
12:46:43 PM: Started saving boot dependencies
12:46:43 PM: Finished saving boot dependencies
12:46:44 PM: Failed during stage 'building site': Build script returned non-zero exit code: 134 (https://ntl.fyi/exit-code-134)
12:46:43 PM: Started saving rust rustup cache
12:46:43 PM: Finished saving rust rustup cache
12:46:43 PM: Started saving go dependencies
12:46:43 PM: Finished saving go dependencies
12:46:44 PM: Error running command: Build script returned non-zero exit code: 134
12:46:44 PM: Failing build: Failed to build site
12:46:45 PM: Finished processing build request in 46.114s

Hiya, welcome to the forums! Are you still experiencing this? I see your most recent build was successful.

Hey! Yeah I’m still experiencing the same issue
The recent builds are successful because I reverted back the package version I mentioned so I can continue working on the website. If I upgrade it the builds will fail again

Hi @HassanZahirnia,

Please use this option: memory - How do I determine the correct "max-old-space-size" for Node.js? - Stack Overflow as an Environment Variable in Netlify.

Hi there, thanks for your suggestion but I’ve already tried that before creating this topic, it made no difference in the outcome unfortunately

Where have you set the variable? I don’t see it in the UI.

Also, what’s the value you’ve set?

Yeah as I said I tried it before creating this topic. But for the sake of walking through this together, I just added it again and re-deployed with the troublesome package upgrade.

You can see my last deploy failed

Interesting, I did not notice this before. Since the OOM issue is happening during the function bundling stage and not the site building stage, this could be something on our end. I’ve asked the devs to take a look.

Thank you very much, I will be patiently waiting for this, although I might downgrade the problematic package so I can continue working on the site. Is that ok? Or do I need leave the failing deployment ?

As long as you don’t delete the deploy, that should be fine. Since your repo is open, I’ve included a link to the current latest commit for the devs to check.

I’m still waiting for a reply from the dev team on the matter we discussed.

Probably unrelated to this topic, In the past day or two, I’ve been experiencing random 500 errors when visiting my website. And I don’t know where to look because there are no logs in the Netlify dashboard. Also the Netlify status page looks fine.

Any ideas on these 500 internal server errors?

Hi Hassan thanks for flagging this! I just nudged the devs for an update.

In regards to the random 500 error we had a network hiccup, but this should no longer be the case. If you are still experiencing this can you reach out so I can flag this to the team.

1 Like

Hey @HassanZahirnia,

The bug has been identified in one of our dependencies: test for out of memory problem with complex glob by danez · Pull Request #533 · isaacs/node-glob (github.com).

Till then, a workaround for you could be:

postcss: {
     plugins: {
       tailwindcss: {},
       autoprefixer: {},
      cssnano:
        process.env.NODE_ENV === 'production'
          ? { preset: ['default', { discardComments: { removeAll: true } }] }
          : false, // disable cssnano when not in production
     },
  }

adding something like that in your nuxt.config

1 Like

Hey! Thanks for your investigation and help throughout this process! :blush::cherry_blossom:

I just tried the workaround you provided and it indeed works nicely. Although I have never messed with cssnano directly so I’m not sure what kind of effect that line has. I hope the end result is similar to what I had before.

Thank you all anyways! Have a great day!