Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Nuxtjs/fonts broke Netlify Build #450

Open
mayashavin opened this issue Jan 11, 2025 · 2 comments
Open

Using Nuxtjs/fonts broke Netlify Build #450

mayashavin opened this issue Jan 11, 2025 · 2 comments

Comments

@mayashavin
Copy link

Steps to re-produce

  1. Add Nuxtjs/fonts to existing Nuxtjs project.
  2. Commit and merge to repo.
  3. Netlify CI to run the build automatically

Expected: It should work and deploy new website.
Actual: Build failed due to stack overflow (see below)

11:07:10 AM: (build.command completed in 23.5s)
11:07:10 AM: ​
11:07:10 AM: Functions bundling                                            
11:07:10 AM: ────────────────────────────────────────────────────────────────
11:07:10 AM: ​
11:07:10 AM: Packaging Functions from .netlify/functions-internal directory:
11:07:10 AM:  - server/server.mjs
11:07:10 AM: ​
11:07:14 AM: Failed during stage 'building site': Build script returned non-zero exit code: 134 (https://ntl.fyi/exit-code-134)
11:07:14 AM: <--- Last few GCs --->
11:07:14 AM: [5737:0x2a4198b0]    31266 ms: Mark-sweep (reduce) 281.4 (328.9) -> 281.3 (296.7) MB, 46.2 / 0.0 ms  (average mu = 0.894, current mu = 0.167) last resort; GC in old space requested
11:07:14 AM: [5737:0x2a4198b0]    31317 ms: Mark-sweep (reduce) 281.3 (296.7) -> 281.3 (296.2) MB, 50.8 / 0.0 ms  (average mu = 0.790, current mu = 0.001) last resort; GC in old space requested
11:07:14 AM: <--- JS stacktrace --->
11:07:14 AM: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
11:07:14 AM:  1: 0xb9c1f0 node::Abort() [/opt/buildhome/node-deps/node]
11:07:14 AM:  2: 0xaa27ee  [/opt/buildhome/node-deps/node]
11:07:14 AM:  3: 0xd73b90 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
11:07:14 AM:  4: 0xd73f37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/buildhome/node-deps/node]
11:07:14 AM:  5: 0xf3f3cf v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/buildhome/node-deps/node]
11:07:14 AM:  6: 0xf1f398 v8::internal::Factory::CodeBuilder::AllocateCode(bool) [/opt/buildhome/node-deps/node]
11:07:14 AM:  7: 0xf3330c v8::internal::Factory::CodeBuilder::BuildInternal(bool) [/opt/buildhome/node-deps/node]
11:07:14 AM:  8: 0xf33d5e v8::internal::Factory::CodeBuilder::Build() [/opt/buildhome/node-deps/node]
11:07:14 AM:  9: 0x15ed5ce v8::internal::RegExpMacroAssemblerX64::GetCode(v8::internal::Handle<v8::internal::String>) [/opt/buildhome/node-deps/node]
11:07:14 AM: 10: 0x12b20c6 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]
11:07:14 AM: 11: 0x12d1ff7 v8::internal::RegExpImpl::Compile(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::RegExpCompileData*, v8::base::Flags<v8::internal::RegExpFlag, int>, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>, bool, unsigned int&) [/opt/buildhome/node-deps/node]
11:07:14 AM: 12: 0x12d2772 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]
11:07:14 AM: 13: 0x12d332e v8::internal::RegExpImpl::IrregexpPrepare(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSRegExp>, v8::internal::Handle<v8::internal::String>) [/opt/buildhome/node-deps/node]
11:07:14 AM: 14: 0x12d34d3 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]
11:07:14 AM: 15: 0x12f886e v8::internal::Runtime_RegExpExec(int, unsigned long*, v8::internal::Isolate*) [/opt/buildhome/node-deps/node]
11:07:14 AM: 16: 0x17122f9  [/opt/buildhome/node-deps/node]
11:07:14 AM: /opt/build-bin/build: line 140:  5737 Aborted                 (core dumped) FORCE_COLOR=1 "$netlify_build_node_bin" --import="$netlify_otel_sdk_setup_bin" "$netlify_build_bin" --cwd="$repository_root" --repositoryRoot="$repository_root" --packagePath="$package_path" --config="$configuration_file_path" --branch="$branch" --siteId="$site_id" --accountId="$account_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.preloadingEnabled="$tracing_preloading_enabled" --tracing.sampleRate="$tracing_sample_rate" --tracing.host="$HOST_NODE_IP" --tracing.traceId="$trace_id" --tracing.parentSpanId="$parent_span_id" --tracing.traceFlags="$trace_flags" --tracing.baggageFilePath="$tracing_baggage_file_path" --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:07:14 AM: Error running command: Build script returned non-zero exit code: 134
11:07:14 AM: Failing build: Failed to build site
11:07:14 AM: Finished processing build request in 1m9.41s

Package.json

  "dependencies": {
    "@nuxt/content": "^2.13.1",
    "@nuxt/eslint": "^0.3.13",
    "@nuxt/fonts": "^0.10.3",
    "@nuxt/image": "^1.7.0",
    "@nuxtjs/google-fonts": "3.2.0",
    "@nuxtjs/i18n": "^8.3.1",
    "@nuxtjs/storybook": "^8.1.1",
    "@nuxtjs/tailwindcss": "^6.12.0",
    "nuxt": "^3.12.3",
    "nuxt-gtag": "^2.0.7",
    "nuxt-simple-robots": "^4.0.0-rc.20",
    "rss": "^1.2.2",
    "sitemap": "^8.0.0",
    "vue": "latest"
  },
"resolutions": {
    "string-width": "4.2.3"
  },
  "devDependencies": {
    "@egoist/tailwindcss-icons": "^1.8.1",
    "@iconify-json/mingcute": "^1.1.18",
    "@nuxtjs/storybook": "7.0.2",
    "@storybook-vue/nuxt": "0.2.6",
    "@storybook/addon-essentials": "8.0.8",
    "@storybook/addon-interactions": "8.0.8",
    "@storybook/addon-links": "8.0.8",
    "@storybook/blocks": "8.0.8",
    "@storybook/builder-vite": "8.0.8",
    "@storybook/test": "8.0.8",
    "@storybook/vue3": "8.0.8",
    "@types/node": "^18.17.5",
    "reading-time": "^1.5.0",
    "remark-reading-time": "^2.0.1",
    "storybook": "8.0.8",
    "unist-util-visit": "^5.0.0"
  },

nuxt.config.js

modules: [
    '@nuxtjs/tailwindcss',
    '@nuxtjs/i18n',
    '@nuxt/image',
    '@nuxt/eslint',
    '@nuxt/content',
    'nuxt-simple-robots',
    '@nuxt/fonts',
    'nuxt-gtag',
  ],
  fonts: {
    default: {
      weights: [200, 300, 400]
    },
    families: [
      { name: 'Gabarito', provider: 'google', global: true, weight: '200' }
    ]
  },
  nitro: {
    prerender: {
      routes: ['/sitemap.xml', '/rss.xml', '/'],
    },
  },

It works locally, only fails in deployment. I tried to build locally but I got error on the pre-render sitemap thing, not the stack overflow error.
Removing prerender and build locally works (not sure if this relates).

@danielroe
Copy link
Member

does it work locally / in production if you only remove the sitemap from being prerendered?

any chance you have a minimal (or any) reproduction?

@qwerzl
Copy link
Member

qwerzl commented Jan 12, 2025

I've run into a similar problem before with my own project. I don't think it's a problem with Fonts - the OOM happens in the functions bundling stage so the problem should be on Netlify's side. Please refer to this for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants