Hi all,
I’ve been trying to deploy a Nuxt 3 app for the past few hours, but all attempts are failing. The app runs well locally using pnpm
as the package manager.
I’ve tried clearing the cache, redeploying, updating dependencies, etc. But, nothing gives.
No public URL is yet available as the site isn’t deployed. But I’ll share the error log and all other relevant information.
In a nutshell, the build is failing at the following line:
8:59:38 AM: [error] [vite]: Rollup failed to resolve import "vue" from "node_modules/.pnpm/nuxt@3.0.0-rc.11/node_modules/nuxt/dist/app/entry.mjs".
Here’s my stripped package.json
file:
{
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview"
},
"devDependencies": {
"@nuxt/content": "^2.1.1",
"@nuxt/image-edge": "1.0.0-27719579.87dcdf2",
"@types/google.maps": "^3.50.0",
"nuxt": "3.0.0-rc.11",
"nuxt-schema-org": "1.1.0-beta.4",
"nuxt-windicss": "^2.5.0",
"sitemap": "^7.1.1"
},
"dependencies": {
"@sendgrid/mail": "^7.7.0",
"@skjnldsv/vue-plyr": "^7.3.0",
"@types/ua-parser-js": "^0.7.36",
"@vueuse/core": "^9.1.1",
"animate.css": "^4.1.1",
"firebase": "^9.12.1",
"firebase-admin": "^11.1.0",
"friendly-challenge": "^0.9.5",
"install": "^0.13.0",
"lite-youtube-embed": "^0.2.0",
"safe-json-stringify": "^1.2.0",
"short-unique-id": "^4.4.4",
"twemoji": "^14.0.2",
"ua-parser-js": "^1.0.2",
"v-use-places-autocomplete": "^1.0.1",
"vue3-lottie": "^2.3.0"
}
}
And the build output log:
8:59:07 AM: Build ready to start
8:59:08 AM: build-image version: d05976bd3309b73a86eaa327bf80e105ff13f5e4 (focal)
8:59:08 AM: build-image tag: v4.13.0
8:59:08 AM: buildbot version: 3a000de5d3727998f3297394596d287d7e49aecd
8:59:08 AM: Building without cache
8:59:08 AM: Starting to prepare the repo for build
8:59:09 AM: No cached dependencies found. Cloning fresh repo
8:59:09 AM: git clone https://github.com/treighmawaka/energycrew-site
8:59:10 AM: Preparing Git Reference refs/heads/main
8:59:11 AM: Parsing package.json dependencies
8:59:12 AM: Starting build script
8:59:12 AM: Installing dependencies
8:59:12 AM: Python version set to 2.7
8:59:12 AM: v16.18.0 is already installed.
8:59:13 AM: Now using node v16.18.0 (npm v8.19.2)
8:59:13 AM: Enabling node corepack
8:59:13 AM: Started restoring cached build plugins
8:59:13 AM: Finished restoring cached build plugins
8:59:13 AM: Attempting ruby version 2.7.2, read from environment
8:59:13 AM: Using ruby version 2.7.2
8:59:14 AM: Using PHP version 8.0
8:59:14 AM: No pnpm workspaces detected
8:59:14 AM: Started restoring cached node modules
8:59:14 AM: Finished restoring cached node modules
8:59:14 AM: Installing NPM modules using PNPM version 7.13.4
8:59:15 AM: Lockfile is up to date, resolution step is skipped
8:59:15 AM: Progress: resolved 1, reused 0, downloaded 0, added 0
8:59:15 AM: Packages: +1007
8:59:15 AM: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8:59:15 AM: Packages are hard linked from the content-addressable store to the virtual store.
8:59:15 AM: Content-addressable store is at: /opt/build/.pnpm-store/v3
8:59:15 AM: Virtual store is at: node_modules/.pnpm
8:59:16 AM: Progress: resolved 1007, reused 0, downloaded 22, added 21
8:59:17 AM: Progress: resolved 1007, reused 0, downloaded 88, added 84
8:59:18 AM: Progress: resolved 1007, reused 0, downloaded 215, added 217
8:59:19 AM: Progress: resolved 1007, reused 0, downloaded 298, added 302
8:59:20 AM: Progress: resolved 1007, reused 0, downloaded 420, added 423
8:59:21 AM: Progress: resolved 1007, reused 0, downloaded 603, added 603
8:59:22 AM: Progress: resolved 1007, reused 0, downloaded 708, added 709
8:59:23 AM: Progress: resolved 1007, reused 0, downloaded 824, added 824
8:59:24 AM: Progress: resolved 1007, reused 0, downloaded 1001, added 1006
8:59:25 AM: Progress: resolved 1007, reused 0, downloaded 1002, added 1007, done
8:59:25 AM: .../node_modules/core-js-pure postinstall$ node -e "try{require('./postinstall')}catch(e){}"
8:59:25 AM: .../core-js@3.25.2/node_modules/core-js postinstall$ node -e "try{require('./postinstall')}catch(e){}"
8:59:25 AM: .../node_modules/protobufjs postinstall$ node scripts/postinstall
8:59:25 AM: .../node_modules/protobufjs postinstall$ node scripts/postinstall
8:59:25 AM: .../node_modules/core-js-pure postinstall: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
8:59:25 AM: .../node_modules/core-js-pure postinstall: The project needs your help! Please consider supporting of core-js:
8:59:25 AM: .../node_modules/core-js-pure postinstall: > https://opencollective.com/core-js
8:59:25 AM: .../node_modules/core-js-pure postinstall: > https://patreon.com/zloirock
8:59:25 AM: .../node_modules/core-js-pure postinstall: > bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
8:59:25 AM: .../node_modules/core-js-pure postinstall: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
8:59:25 AM: .../node_modules/core-js-pure postinstall: Done
8:59:25 AM: .../core-js@3.25.2/node_modules/core-js postinstall: Done
8:59:25 AM: .../node_modules/protobufjs postinstall: Done
8:59:25 AM: .../node_modules/protobufjs postinstall: Done
8:59:25 AM: .../sharp@0.30.7/node_modules/sharp install$ (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
8:59:26 AM: .../node_modules/vue-demi postinstall$ node ./scripts/postinstall.js
8:59:26 AM: .../node_modules/vue-demi postinstall$ node ./scripts/postinstall.js
8:59:26 AM: .../node_modules/vue-demi postinstall$ node ./scripts/postinstall.js
8:59:26 AM: .../node_modules/vue-demi postinstall: Done
8:59:26 AM: .../node_modules/vue-demi postinstall: Done
8:59:26 AM: .../node_modules/vue-demi postinstall: Done
8:59:26 AM: .../sharp@0.30.7/node_modules/sharp install: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-linux-x64.tar.br
8:59:27 AM: .../sharp@0.30.7/node_modules/sharp install: sharp: Integrity check passed for linux-x64
8:59:27 AM: .../sharp@0.30.7/node_modules/sharp install: Done
8:59:27 AM: .../esbuild@0.15.9/node_modules/esbuild postinstall$ node install.js
8:59:27 AM: .../esbuild@0.15.9/node_modules/esbuild postinstall: Done
8:59:28 AM: dependencies:
8:59:28 AM: + @sendgrid/mail 7.7.0
8:59:28 AM: + @skjnldsv/vue-plyr 7.3.0
8:59:28 AM: + @types/ua-parser-js 0.7.36
8:59:28 AM: + @vueuse/core 9.2.0
8:59:28 AM: + animate.css 4.1.1
8:59:28 AM: + firebase 9.12.1
8:59:28 AM: + firebase-admin 11.1.0
8:59:28 AM: + friendly-challenge 0.9.7
8:59:28 AM: + install 0.13.0
8:59:28 AM: + lite-youtube-embed 0.2.0
8:59:28 AM: + safe-json-stringify 1.2.0
8:59:28 AM: + short-unique-id 4.4.4
8:59:28 AM: + twemoji 14.0.2
8:59:28 AM: + ua-parser-js 1.0.2
8:59:28 AM: + v-use-places-autocomplete 1.0.1
8:59:28 AM: + vue3-lottie 2.3.0
8:59:28 AM: devDependencies:
8:59:28 AM: + @nuxt/content 2.1.1
8:59:28 AM: + @nuxt/image-edge 1.0.0-27719579.87dcdf2
8:59:28 AM: + @types/google.maps 3.50.2
8:59:28 AM: + nuxt 3.0.0-rc.11
8:59:28 AM: + nuxt-schema-org 1.1.0-beta.4
8:59:28 AM: + nuxt-windicss 2.5.2
8:59:28 AM: + sitemap 7.1.1
8:59:28 AM: Done in 13.2s
8:59:28 AM: NPM modules installed using PNPM
8:59:28 AM: Started restoring cached go cache
8:59:28 AM: Finished restoring cached go cache
8:59:28 AM: Installing Go version 1.17 (requested 1.17)
8:59:32 AM: unset GOOS;
8:59:32 AM: unset GOARCH;
8:59:32 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
8:59:32 AM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
8:59:32 AM: go version >&2;
8:59:32 AM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
8:59:32 AM: go version go1.17 linux/amd64
8:59:32 AM: Installing missing commands
8:59:32 AM: Verify run directory
8:59:34 AM:
8:59:34 AM: ────────────────────────────────────────────────────────────────
8:59:34 AM: Netlify Build
8:59:34 AM: ────────────────────────────────────────────────────────────────
8:59:34 AM:
8:59:34 AM: ❯ Version
8:59:34 AM: @netlify/build 27.20.6
8:59:34 AM:
8:59:34 AM: ❯ Flags
8:59:34 AM: baseRelDir: true
8:59:34 AM: buildId: 634ff49bb6f18f0358e48b27
8:59:34 AM: deployId: 634ff49bb6f18f0358e48b29
8:59:34 AM:
8:59:34 AM: ❯ Current directory
8:59:34 AM: /opt/build/repo
8:59:34 AM:
8:59:34 AM: ❯ Config file
8:59:34 AM: No config file was defined: using default values.
8:59:34 AM:
8:59:34 AM: ❯ Context
8:59:34 AM: production
8:59:34 AM:
8:59:34 AM: ────────────────────────────────────────────────────────────────
8:59:34 AM: 1. Build command from Netlify app
8:59:34 AM: ────────────────────────────────────────────────────────────────
8:59:34 AM:
8:59:34 AM: $ npm run build
8:59:34 AM: > build
8:59:34 AM: > nuxt build
8:59:34 AM: [log] Nuxi 3.0.0-rc.11
8:59:34 AM: [log] Nuxt 3.0.0-rc.11 with Nitro 0.5.4
8:59:37 AM: [success] [@nuxt/content] Using `~/components/content` for components in Markdown
8:59:38 AM: [error] [vite]: Rollup failed to resolve import "vue" from "node_modules/.pnpm/nuxt@3.0.0-rc.11/node_modules/nuxt/dist/app/entry.mjs".
8:59:38 AM: This is most likely unintended because it can break your application at runtime.
8:59:38 AM: If you do want to externalize this module explicitly add it to
8:59:38 AM: `build.rollupOptions.external`
8:59:38 AM: [error] [vite]: Rollup failed to resolve import "vue" from "node_modules/.pnpm/nuxt@3.0.0-rc.11/node_modules/nuxt/dist/app/entry.mjs".
8:59:38 AM: This is most likely unintended because it can break your application at runtime.
8:59:38 AM: If you do want to externalize this module explicitly add it to
8:59:38 AM: `build.rollupOptions.external`
8:59:38 AM: This is most likely unintended because it can break your application at runtime.
8:59:38 AM: If you do want to externalize this module explicitly add it to
8:59:38 AM: `build.rollupOptions.external`
8:59:38 AM: at onRollupWarning (node_modules/.pnpm/vite@3.1.3/node_modules/vite/dist/node/chunks/dep-557f29e6.js:45907:19)
8:59:38 AM: at onwarn (node_modules/.pnpm/vite@3.1.3/node_modules/vite/dist/node/chunks/dep-557f29e6.js:45705:13)
8:59:38 AM: at Object.onwarn (node_modules/.pnpm/rollup@2.78.1/node_modules/rollup/dist/es/shared/rollup.js:23225:13)
8:59:38 AM: at ModuleLoader.handleResolveId (node_modules/.pnpm/rollup@2.78.1/node_modules/rollup/dist/es/shared/rollup.js:22352:26)
8:59:38 AM: at node_modules/.pnpm/rollup@2.78.1/node_modules/rollup/dist/es/shared/rollup.js:22313:26
8:59:38 AM:
8:59:38 AM: ────────────────────────────────────────────────────────────────
8:59:38 AM: "build.command" failed
8:59:38 AM: ────────────────────────────────────────────────────────────────
8:59:38 AM:
8:59:38 AM: Error message
8:59:38 AM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
8:59:38 AM:
8:59:38 AM: Error location
8:59:38 AM: In Build command from Netlify app:
8:59:38 AM: npm run build
8:59:38 AM:
8:59:38 AM: Resolved config
8:59:38 AM: build:
8:59:38 AM: command: npm run build
8:59:38 AM: commandOrigin: ui
8:59:38 AM: environment:
8:59:38 AM: - CI
8:59:38 AM: - FIREBASE_API_KEY
8:59:38 AM: - FIREBASE_APP_ID
8:59:38 AM: - FIREBASE_AUTH_DOMAIN
8:59:38 AM: - FIREBASE_MEASUREMENT_ID
8:59:38 AM: - FIREBASE_MESSAGING_SENDER_ID
8:59:38 AM: - FIREBASE_PROJECT_ID
8:59:38 AM: - FIREBASE_STORAGE_BUCKET
8:59:38 AM: - FRIENDLY_CAPTCHA_API_KEY
8:59:38 AM: - FRIENDLY_CAPTCHA_SITE_KEY
8:59:38 AM: - GOOGLE_PLACES_API_KEY
8:59:38 AM: - SENDGRID_API_KEY
8:59:38 AM: - SENDGRID_BOOKING_REQUEST_TEMPLATE_ID
8:59:38 AM: - SENDGRID_BOOKING_TEMPLATE_ID
8:59:38 AM: - SENDGRID_CONTACT_TEMPLATE_ID
8:59:38 AM: - SENDGRID_QUOTE_TEMPLATE_ID
8:59:38 AM: - SENDGRID_REMIDER_TEMPLATE_ID
8:59:38 AM: - SENDGRID_REQUEST_TEMPLATE_ID
8:59:38 AM: - SENDGRID_REVIEW_TEMPLATE_ID
8:59:38 AM: publish: /opt/build/repo/dist
8:59:38 AM: publishOrigin: ui
8:59:38 AM: Caching artifacts
8:59:38 AM: Started saving node modules
8:59:38 AM: Finished saving node modules
8:59:38 AM: Started saving build plugins
8:59:38 AM: Finished saving build plugins
8:59:38 AM: Started saving pip cache
8:59:38 AM: Finished saving pip cache
8:59:38 AM: Started saving emacs cask dependencies
8:59:38 AM: Finished saving emacs cask dependencies
8:59:38 AM: Started saving maven dependencies
8:59:38 AM: Finished saving maven dependencies
8:59:38 AM: Started saving boot dependencies
8:59:38 AM: Finished saving boot dependencies
8:59:38 AM: Started saving rust rustup cache
8:59:38 AM: Finished saving rust rustup cache
8:59:38 AM: Started saving go dependencies
8:59:38 AM: Finished saving go dependencies
8:59:39 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:59:39 AM: Creating deploy upload records
8:59:40 AM: Failing build: Failed to build site
8:59:40 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
8:59:40 AM: Finished processing build request in 31.601942915s
I’d appreciate any help. Thanks in advance.