Nuxt JS Static Site fails to build and deploys hang until manually cancelled

Hi,

I have another Nuxt static site failing to build and deploy. This is similar to the last thread I opened, about a different Nuxt static site, but the fix I found for that does not work and error log is slightly different. All my Nuxt sites fail to build/deploy and require a slightly different solution to complete the build/deploy.

Also, this deploy appears to β€œhang” in building mode within the Site Overview UI, even though the log says it is completed and failed. I must go in and manually cancel the build for the status on the UI in the dashboard to update properly.

I have tried using different versions of NODE in the toml file, clearing cache and also deleting package lock and yarn lock files so far.

Error Log:

11:43:43 AM: Build ready to start
11:43:46 AM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
11:43:46 AM: build-image tag: v3.7.0
11:43:46 AM: buildbot version: c469f7ab4d394d961ca036b1163fdbb6ef9fb78c
11:43:46 AM: Fetching cached dependencies
11:43:46 AM: Starting to download cache of 674.8MB
11:43:50 AM: Finished downloading cache in 4.225334151s
11:43:50 AM: Starting to extract cache
11:44:03 AM: Finished extracting cache in 12.823173875s
11:44:03 AM: Finished fetching cache in 17.280429516s
11:44:03 AM: Starting to prepare the repo for build
11:44:04 AM: Preparing Git Reference refs/heads/master
11:44:08 AM: Different build command detected, going to use the one specified in the Netlify configuration file: β€˜npm run generate’ versus β€˜CI= npm run generate’ in the Netlify UI
11:44:08 AM: Starting build script
11:44:08 AM: Installing dependencies
11:44:08 AM: Python version set to 2.7
11:44:09 AM: Started restoring cached node version
11:44:12 AM: Finished restoring cached node version
11:44:13 AM: Downloading and installing node v11.15.0…
11:44:13 AM: Downloading https://nodejs.org/dist/v11.15.0/node-v11.15.0-linux-x64.tar.xz…
11:44:14 AM: Computing checksum with sha256sum
11:44:14 AM: Checksums matched!
11:44:17 AM: Now using node v11.15.0 (npm v6.7.0)
11:44:17 AM: Started restoring cached build plugins
11:44:17 AM: Finished restoring cached build plugins
11:44:17 AM: Attempting ruby version 2.7.1, read from environment
11:44:18 AM: Using ruby version 2.7.1
11:44:19 AM: Using PHP version 5.6
11:44:19 AM: Started restoring cached node modules
11:44:19 AM: Finished restoring cached node modules
11:44:19 AM: Installing NPM modules using NPM version 6.7.0
11:44:27 AM: npm WARN deprecated axios@0.19.0: Critical security vulnerability fixed in v0.21.1. For more information, see Hotfix: Prevent SSRF by timemachine3030 Β· Pull Request #3410 Β· axios/axios Β· GitHub
11:44:35 AM: npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
11:44:36 AM: npm WARN deprecated @nuxt/static@1.0.0: this feature has been moved to the core. you can directly use nuxt generate
11:44:40 AM: npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
11:44:45 AM: npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
11:45:01 AM: npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
11:45:01 AM: npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
11:45:07 AM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
11:45:07 AM: npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
11:45:16 AM: npm WARN deprecated npm-publish-git-tag@3.0.4: This package has been re-pubished as @hutson/npm-deploy-git-tag. Please consider removing the old package and installing the new package.
11:45:16 AM: npm WARN deprecated @hutson/set-npm-auth-token-for-ci@2.1.0: This package is no longer maintained. If you would like to use the functionality offered by this package, please consider publishing a fork of this package under your own npm scope.
11:45:21 AM: npm WARN deprecated mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
11:45:23 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see Request’s Past, Present and Future Β· Issue #3142 Β· request/request Β· GitHub
11:45:24 AM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
11:46:02 AM: npm WARN rm not removing /opt/build/repo/node_modules/.bin/semver as it wasn’t installed by /opt/build/repo/node_modules/semvernpm WARN rm not removing /opt/build/repo/node_modules/.bin/nopt as it wasn’t installed by /opt/build/repo/node_modules/noptnpm WARN rm not removing /opt/build/repo/node_modules/.bin/browserslist as it wasn’t installed by /opt/build/repo/node_modules/browserslistnpm WARN rm not removing /opt/build/repo/node_modules/.bin/json5 as it wasn’t installed by /opt/build/repo/node_modules/json5npm WARN rm not removing /opt/build/repo/node_modules/.bin/jiti as it wasn’t installed by /opt/build/repo/node_modules/jiti
11:46:02 AM: > node-sass@4.13.0 install /opt/build/repo/node_modules/node-sass
11:46:02 AM: > node scripts/install.js
11:46:03 AM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/linux-x64-67_binding.node
11:46:03 AM: Download complete
11:46:03 AM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-67/binding.node
11:46:03 AM: Caching binary to /opt/buildhome/.npm/node-sass/4.13.0/linux-x64-67_binding.node
11:46:03 AM: > @fortawesome/fontawesome-common-types@0.2.34 postinstall /opt/build/repo/node_modules/@fortawesome/fontawesome-common-types
11:46:03 AM: > node attribution.js
11:46:03 AM: Font Awesome Free 0.2.34 by @fontawesome - https://fontawesome.com
11:46:03 AM: License - Font Awesome (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:46:03 AM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/core-js
11:46:03 AM: > node -e β€œtry{require(’./postinstall’)}catch(e){}”
11:46:03 AM: > ejs@2.7.4 postinstall /opt/build/repo/node_modules/ejs
11:46:03 AM: > node ./postinstall.js
11:46:04 AM: > preact@8.5.3 postinstall /opt/build/repo/node_modules/preact
11:46:04 AM: > node -e β€œconsole.log(’\u001b[35m\u001b[1mLove Preact? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/preact/donate\u001b[0m’)”
11:46:04 AM: Love Preact? You can now donate to our open collective:
11:46:04 AM: > Contribute to Preact - Open Collective
11:46:04 AM: > @fortawesome/fontawesome-svg-core@1.2.34 postinstall /opt/build/repo/node_modules/@fortawesome/fontawesome-svg-core
11:46:04 AM: > node attribution.js
11:46:04 AM: Font Awesome Free 1.2.34 by @fontawesome - https://fontawesome.com
11:46:04 AM: License - Font Awesome (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:46:04 AM: > @fortawesome/free-solid-svg-icons@5.15.2 postinstall /opt/build/repo/node_modules/@fortawesome/free-solid-svg-icons
11:46:04 AM: > node attribution.js
11:46:04 AM: Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
11:46:04 AM: License - Font Awesome (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
11:46:04 AM: > bootstrap-vue@2.21.2 postinstall /opt/build/repo/node_modules/bootstrap-vue
11:46:04 AM: > opencollective || exit 0
11:46:05 AM: > node-sass@4.13.0 postinstall /opt/build/repo/node_modules/node-sass
11:46:05 AM: > node scripts/build.js
11:46:05 AM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-67/binding.node
11:46:05 AM: Testing binary
11:46:05 AM: Binary is fine
11:46:05 AM: > nuxt@2.14.7 postinstall /opt/build/repo/node_modules/nuxt
11:46:05 AM: > opencollective || exit 0
11:46:05 AM: (node:1379) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
11:46:08 AM: npm notice created a lockfile as package-lock.json. You should commit this file.
11:46:08 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents):
11:46:08 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
11:46:08 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
11:46:08 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
11:46:08 AM: npm WARN bootstrap@4.6.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
11:46:08 AM: npm WARN vue2-leaflet@2.6.0 requires a peer of @types/leaflet@^1.5.7 but none is installed. You must install peer dependencies yourself.
11:46:08 AM: npm WARN sass-loader@8.0.0 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
11:46:08 AM: npm WARN sass-loader@8.0.0 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
11:46:08 AM: added 250 packages from 91 contributors, removed 193 packages, updated 1264 packages and audited 1518 packages in 107.399s
11:46:08 AM: found 341 vulnerabilities (340 low, 1 high)
11:46:08 AM: run npm audit fix to fix them, or npm audit for details
11:46:08 AM: NPM modules installed
11:46:08 AM: Started restoring cached go cache
11:46:08 AM: Finished restoring cached go cache
11:46:08 AM: go version go1.14.4 linux/amd64
11:46:08 AM: go version go1.14.4 linux/amd64
11:46:08 AM: Installing missing commands
11:46:08 AM: Verify run directory
11:46:10 AM: ​
11:46:10 AM: ────────────────────────────────────────────────────────────────
11:46:10 AM: Netlify Build
11:46:10 AM: ────────────────────────────────────────────────────────────────
11:46:10 AM: ​
11:46:10 AM: ❯ Version
11:46:10 AM: @netlify/build 9.9.5
11:46:10 AM: ​
11:46:10 AM: ❯ Flags
11:46:10 AM: apiHost: api.netlify.com
11:46:10 AM: cacheDir: /opt/build/cache
11:46:10 AM: deployId: 604f80afabb4b700077f7ab9
11:46:10 AM: mode: buildbot
11:46:10 AM: testOpts:
11:46:10 AM: silentLingeringProcesses: β€˜β€™
11:46:11 AM: ​
11:46:11 AM: ❯ Current directory
11:46:11 AM: /opt/build/repo
11:46:11 AM: ​
11:46:11 AM: ❯ Config file
11:46:11 AM: /opt/build/repo/netlify.toml
11:46:11 AM: ​
11:46:11 AM: ❯ Context
11:46:11 AM: production
11:46:11 AM: ​
11:46:11 AM: ────────────────────────────────────────────────────────────────
11:46:11 AM: 1. build.command from netlify.toml
11:46:11 AM: ────────────────────────────────────────────────────────────────
11:46:11 AM: ​
11:46:11 AM: $ npm run generate
11:46:11 AM: > wp-nuxt@1.0.0 generate /opt/build/repo
11:46:11 AM: > nuxt generate
11:46:11 AM: [fatal] globalThis is not defined
11:46:11 AM: at Object. (node_modules/queue-microtask/index.js:5:25)
11:46:11 AM: at Module._compile (internal/modules/cjs/loader.js:816:30)
11:46:11 AM: at Object.Module._extensions…js (internal/modules/cjs/loader.js:827:10)
11:46:11 AM: at Module.load (internal/modules/cjs/loader.js:685:32)
11:46:11 AM: at Function.Module._load (internal/modules/cjs/loader.js:620:12)
11:46:11 AM: at Module.require (internal/modules/cjs/loader.js:723:19)
11:46:11 AM: at require (internal/modules/cjs/helpers.js:14:16)
11:46:11 AM: at Object. (node_modules/run-parallel/index.js:4:24)
11:46:11 AM: at Module._compile (internal/modules/cjs/loader.js:816:30)
11:46:11 AM: at Object.Module._extensions…js (internal/modules/cjs/loader.js:827:10)
11:46:12 AM: npm ERR! code ELIFECYCLE
11:46:12 AM: npm ERR! errno 2
11:46:12 AM: npm ERR! wp-nuxt@1.0.0 generate: nuxt generate
11:46:12 AM: npm ERR! Exit status 2
11:46:12 AM: npm ERR!
11:46:12 AM: npm ERR! Failed at the wp-nuxt@1.0.0 generate script.
11:46:12 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
11:46:12 AM: npm ERR! A complete log of this run can be found in:
11:46:12 AM: npm ERR! /opt/buildhome/.npm/_logs/2021-03-15T15_46_12_014Z-debug.log
11:46:12 AM: ​
11:46:12 AM: ────────────────────────────────────────────────────────────────
11:46:12 AM: β€œbuild.command” failed
11:46:12 AM: ────────────────────────────────────────────────────────────────
11:46:12 AM: ​
11:46:12 AM: Error message
11:46:12 AM: Command failed with exit code 2: npm run generate
11:46:12 AM: ​
11:46:12 AM: Error location
11:46:12 AM: In build.command from netlify.toml:
11:46:12 AM: npm run generate
11:46:12 AM: ​
11:46:12 AM: Resolved config
11:46:12 AM: build:
11:46:12 AM: command: npm run generate
11:46:12 AM: commandOrigin: config
11:46:12 AM: environment:
11:46:12 AM: - NODE_VERSION
11:46:12 AM: publish: /opt/build/repo/dist
11:46:12 AM: redirects:
11:46:12 AM: - force: true
11:46:12 AM: from: /distributors/* status: 200 to: https://distributor-locator.netlify.app/:splat - from: /blog status: 301 to: /resources/industrial-automation-blogCaching artifacts
11:46:12 AM: Started saving node modules
11:46:12 AM: Finished saving node modules
11:46:12 AM: Started saving build plugins
11:46:12 AM: Finished saving build plugins
11:46:12 AM: Started saving pip cache
11:46:12 AM: Finished saving pip cache
11:46:12 AM: Started saving emacs cask dependencies
11:46:12 AM: Finished saving emacs cask dependencies
11:46:12 AM: Started saving maven dependencies
11:46:12 AM: Finished saving maven dependencies
11:46:12 AM: Started saving boot dependencies
11:46:12 AM: Finished saving boot dependencies
11:46:12 AM: Started saving rust rustup cache
11:46:12 AM: Finished saving rust rustup cache
11:46:12 AM: Started saving go dependencies
11:46:12 AM: Finished saving go dependencies
11:46:18 AM: Build script success
11:47:28 AM: Finished processing build request in 3m42.787167994s
11:49:10 AM: Canceling deploy

The deploy is not hanging, it’s failing, because of this:

1 Like

Hi all,

For anyone I was able to resolve this issue with the following steps on this one:

  • Add the babel/preset-env v7.12.17 package as a dependency
  • Set Node version to 12 in the toml file
  • Changed the build command to β€œCI= npm run generate”

These nuxt + netlify sites are all breaking and each fix seems different so stay strong.

Hey there, @hzayas

Thank you so much for sharing your resolution with us! This is always helpful for future Forums members who happen upon a similar situation. :netlisparkles: