Plugin "@netlify/plugin-nextjs" failed

This is odd. I copied a functioning repository to make this one, but I get an error building this one only. I’ve included build logs below from both sites.

Nonfunctioning Site: jolly-blackwell-c29d31

Build Log:

1:16:23 PM: Build ready to start
1:16:25 PM: build-image version: be42e453d6c8f171cc2f654acc29c0a8b60e6d93
1:16:25 PM: build-image tag: v3.7.1
1:16:25 PM: buildbot version: 94f1b7736437a080e02c046e77c9a098022fec84
1:16:25 PM: Fetching cached dependencies
1:16:25 PM: Failed to fetch cache, continuing with build
1:16:25 PM: Starting to prepare the repo for build
1:16:26 PM: No cached dependencies found. Cloning fresh repo
1:16:26 PM: git clone https://github.com/dancancro/mivotes
1:16:29 PM: Preparing Git Reference refs/heads/master
1:16:32 PM: Starting build script
1:16:32 PM: Installing dependencies
1:16:32 PM: Python version set to 2.7
1:16:33 PM: v12.18.0 is already installed.
1:16:34 PM: Now using node v12.18.0 (npm v6.14.4)
1:16:34 PM: Started restoring cached build plugins
1:16:34 PM: Finished restoring cached build plugins
1:16:34 PM: Attempting ruby version 2.7.1, read from environment
1:16:36 PM: Using ruby version 2.7.1
1:16:36 PM: Using PHP version 5.6
1:16:36 PM: Started restoring cached node modules
1:16:36 PM: Finished restoring cached node modules
1:16:36 PM: Installing NPM modules using NPM version 6.14.4
1:17:19 PM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I’ll try to do my best with it!
1:17:19 PM: > core-js-pure@3.1.4 postinstall /opt/build/repo/node_modules/core-js-pure
1:17:19 PM: > node scripts/postinstall || echo β€œignore”
1:17:21 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
1:17:21 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
1:17:21 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/webpack/node_modules/fsevents):
1:17:21 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
1:17:21 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/next/node_modules/fsevents):
1:17:21 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
1:17:21 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fork-ts-checker-webpack-plugin/node_modules/fsevents):
1:17:21 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
1:17:21 PM: added 1698 packages from 573 contributors and audited 1769 packages in 43.953s
1:17:22 PM: 37 packages are looking for funding
1:17:22 PM: run npm fund for details
1:17:22 PM: found 16 vulnerabilities (4 low, 4 moderate, 8 high)
1:17:22 PM: run npm audit fix to fix them, or npm audit for details
1:17:22 PM: NPM modules installed
1:17:23 PM: Started restoring cached go cache
1:17:23 PM: Finished restoring cached go cache
1:17:23 PM: go version go1.14.4 linux/amd64
1:17:23 PM: go version go1.14.4 linux/amd64
1:17:23 PM: Installing missing commands
1:17:23 PM: Verify run directory
1:17:25 PM: ​
1:17:25 PM: ────────────────────────────────────────────────────────────────
1:17:25 PM: Netlify Build
1:17:25 PM: ────────────────────────────────────────────────────────────────
1:17:25 PM: ​
1:17:25 PM: ❯ Version
1:17:25 PM: @netlify/build 10.2.7
1:17:25 PM: ​
1:17:25 PM: ❯ Flags
1:17:25 PM: deployId: 60732ee7fb8cb2f613d84bdd
1:17:25 PM: ​
1:17:25 PM: ❯ Current directory
1:17:25 PM: /opt/build/repo
1:17:25 PM: ​
1:17:25 PM: ❯ Config file
1:17:25 PM: /opt/build/repo/netlify.toml
1:17:25 PM: ​
1:17:25 PM: ❯ Context
1:17:25 PM: production
1:17:25 PM: ​
1:17:25 PM: ❯ Installing plugins
1:17:25 PM: - @netlify/plugin-nextjs@1.1.3
1:17:47 PM: ​
1:17:47 PM: ❯ Loading plugins
1:17:47 PM: - @netlify/plugin-nextjs@1.1.3 from Netlify app
1:17:47 PM: ​
1:17:47 PM: ❯ Outdated plugins
1:17:47 PM: - @netlify/plugin-nextjs@1.1.3: latest version is 3.0.3 which is incompatible with next@<10.0.6
1:17:47 PM: ​
1:17:47 PM: ────────────────────────────────────────────────────────────────
1:17:47 PM: 1. onPreBuild command from @netlify/plugin-nextjs
1:17:47 PM: ────────────────────────────────────────────────────────────────
1:17:47 PM: ​
1:17:47 PM: ​
1:17:47 PM: ────────────────────────────────────────────────────────────────
1:17:47 PM: Plugin β€œ@netlify/plugin-nextjs” failed
1:17:47 PM: ────────────────────────────────────────────────────────────────
1:17:47 PM: ​
1:17:47 PM: Error message
1:17:47 PM: Error: Please upgrade to Next.js 9.5.3 or later
1:17:47 PM: ​
1:17:47 PM: Plugin details
1:17:47 PM: Package: @netlify/plugin-nextjs
1:17:47 PM: Version: 1.1.3
1:17:47 PM: Repository: git+https://github.com/netlify/netlify-plugin-nextjs.git
1:17:47 PM: npm link: @netlify/plugin-nextjs - npm
1:17:47 PM: Report issues: Issues Β· netlify/next-runtime Β· GitHub
1:17:47 PM: ​
1:17:47 PM: Error location
1:17:47 PM: In β€œonPreBuild” event in β€œ@netlify/plugin-nextjs” from Netlify app
1:17:47 PM: at validateNextUsage (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/helpers/validateNextUsage.js:18:12)
1:17:47 PM: at onPreBuild (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/index.js:20:5)
1:17:47 PM: ​
1:17:47 PM: Resolved config
1:17:47 PM: build:
1:17:47 PM: command: npm run export
1:17:47 PM: commandOrigin: ui
1:17:47 PM: publish: /opt/build/repo/out
1:17:47 PM: plugins:
1:17:47 PM: - inputs: {}
1:17:47 PM: origin: ui
1:17:47 PM: package: β€˜@netlify/plugin-nextjs’
1:17:47 PM: redirects:
1:17:47 PM: - from: /service-worker.js
1:17:47 PM: status: 200
1:17:47 PM: to: /static/service-worker.js
1:17:48 PM: Caching artifacts
1:17:48 PM: Started saving node modules
1:17:48 PM: Finished saving node modules
1:17:48 PM: Started saving build plugins
1:17:48 PM: Finished saving build plugins
1:17:48 PM: Started saving pip cache
1:17:48 PM: Finished saving pip cache
1:17:48 PM: Started saving emacs cask dependencies
1:17:48 PM: Finished saving emacs cask dependencies
1:17:48 PM: Started saving maven dependencies
1:17:48 PM: Finished saving maven dependencies
1:17:48 PM: Started saving boot dependencies
1:17:48 PM: Finished saving boot dependencies
1:17:48 PM: Started saving rust rustup cache
1:17:48 PM: Finished saving rust rustup cache
1:17:48 PM: Started saving go dependencies
1:17:48 PM: Finished saving go dependencies
1:17:51 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:17:51 PM: Creating deploy upload records
1:17:51 PM: Failing build: Failed to build site
1:17:51 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
1:17:51 PM: Finished processing build request in 1m25.940233435s

Functioning Site: suspicious-goldstine-eb2ca5

Build Log:

5:41:53 PM: Build ready to start
5:41:55 PM: build-image version: be42e453d6c8f171cc2f654acc29c0a8b60e6d93
5:41:55 PM: build-image tag: v3.7.1
5:41:55 PM: buildbot version: 94f1b7736437a080e02c046e77c9a098022fec84
5:41:55 PM: Fetching cached dependencies
5:41:55 PM: Starting to download cache of 621.6MB
5:41:59 PM: Finished downloading cache in 4.360000745s
5:41:59 PM: Starting to extract cache
5:42:22 PM: Finished extracting cache in 22.423649282s
5:42:22 PM: Finished fetching cache in 26.992990574s
5:42:22 PM: Starting to prepare the repo for build
5:42:22 PM: Preparing Git Reference refs/heads/master
5:42:25 PM: Starting build script
5:42:25 PM: Installing dependencies
5:42:25 PM: Python version set to 2.7
5:42:26 PM: Started restoring cached node version
5:42:37 PM: Finished restoring cached node version
5:42:38 PM: v10.24.1 is already installed.
5:42:39 PM: Now using node v10.24.1 (npm v6.14.12)
5:42:39 PM: Started restoring cached build plugins
5:42:39 PM: Finished restoring cached build plugins
5:42:39 PM: Attempting ruby version 2.6.2, read from environment
5:42:41 PM: Using ruby version 2.6.2
5:42:41 PM: Using PHP version 5.6
5:42:41 PM: Started restoring cached node modules
5:42:41 PM: Finished restoring cached node modules
5:42:41 PM: Started restoring cached go cache
5:42:44 PM: Finished restoring cached go cache
5:42:44 PM: Installing Go version 1.12
5:42:44 PM: unset GOOS;
5:42:44 PM: unset GOARCH;
5:42:44 PM: export GOROOT=β€˜/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
5:42:44 PM: export PATH=β€œ/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}”;
5:42:44 PM: go version >&2;
5:42:44 PM: export GIMME_ENV=β€˜/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env’;
5:42:44 PM: go version go1.12 linux/amd64
5:42:44 PM: Installing missing commands
5:42:44 PM: Verify run directory
5:42:46 PM: ​
5:42:46 PM: ────────────────────────────────────────────────────────────────
5:42:46 PM: Netlify Build
5:42:46 PM: ────────────────────────────────────────────────────────────────
5:42:46 PM: ​
5:42:46 PM: ❯ Version
5:42:46 PM: @netlify/build 10.2.7
5:42:46 PM: ​
5:42:46 PM: ❯ Flags
5:42:46 PM: deployId: 60721ba1508db60007f2ce6f
5:42:46 PM: ​
5:42:46 PM: ❯ Current directory
5:42:46 PM: /opt/build/repo
5:42:46 PM: ​
5:42:46 PM: ❯ Config file
5:42:46 PM: /opt/build/repo/netlify.toml
5:42:46 PM: ​
5:42:46 PM: ❯ Context
5:42:46 PM: production
5:42:46 PM: ​
5:42:46 PM: ────────────────────────────────────────────────────────────────
5:42:46 PM: 1. Build command from Netlify app
5:42:46 PM: ────────────────────────────────────────────────────────────────
5:42:46 PM: ​
5:42:46 PM: $ npm run export
5:42:47 PM: > my-site@1.0.0 export /opt/build/repo
5:42:47 PM: > npm run build:server && npm run export:server
5:42:47 PM: > my-site@1.0.0 build:server /opt/build/repo
5:42:47 PM: > NEXT_TARGET=server next build
5:42:48 PM: Browserslist: caniuse-lite is outdated. Please run:
5:42:48 PM: npx browserslist@latest --update-db
5:42:49 PM: Warning: No build cache found. Please configure build caching for faster rebuilds. Read more: no-cache | Next.js
5:42:49 PM: Creating an optimized production build…
5:42:52 PM: > Using external babel configuration
5:42:52 PM: > Location: β€œ/opt/build/repo/.babelrc”
5:42:58 PM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/static/questions.js as it exceeds the max of 500KB.
5:42:58 PM: [BABEL] Note: The code generator has deoptimised the styling of /opt/build/repo/static/questions.js as it exceeds the max of 500KB.
5:43:12 PM: Compiled successfully.
5:43:12 PM:
5:43:12 PM: Automatically optimizing pages…
5:43:14 PM: Page Size First Load
5:43:14 PM: ─ β—‹ / 100 kB 385 kB
5:43:14 PM: + shared by all 54.8 kB
5:43:14 PM: β”œ static/pages/_app.js 960 B
5:43:14 PM: β”œ chunks/d7d1605974af4f69e70ea58fdd768a8a18a17a57.27b42a.js 10 kB
5:43:14 PM: β”œ chunks/framework.ed4591.js 37.3 kB
5:43:14 PM: β”œ runtime/main.3a4eb4.js 5.75 kB
5:43:14 PM: β”” runtime/webpack.b65cab.js 746 B
5:43:14 PM: Ξ» (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
5:43:14 PM: β—‹ (Static) automatically rendered as static HTML (uses no initial props)
5:43:14 PM: ● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
5:43:15 PM: > my-site@1.0.0 export:server /opt/build/repo
5:43:15 PM: > NEXT_TARGET=server next export
5:43:16 PM: > using build directory: /opt/build/repo/.next
5:43:16 PM: copying β€œstatic” directory
5:43:16 PM: copying β€œstatic build” directory
5:43:16 PM: launching 7 workers
5:43:16 PM: Exporting (0/3)
5:43:16 PM: Exporting (1/3)
5:43:16 PM: Exporting (2/3)
5:43:16 PM: Exporting (3/3)
5:43:16 PM: Export successful
5:43:16 PM: ​
5:43:16 PM: (build.command completed in 30s)
5:43:16 PM: ​
5:43:16 PM: ────────────────────────────────────────────────────────────────
5:43:16 PM: Creating deploy upload records
5:43:16 PM: 2. Deploy site
5:43:16 PM: ────────────────────────────────────────────────────────────────
5:43:16 PM: ​
5:43:16 PM: Starting to deploy site from β€˜out’
5:43:16 PM: Creating deploy tree
5:43:17 PM: 7 new files to upload
5:43:17 PM: 0 new functions to upload
5:43:17 PM: Site deploy was successfully initiated
5:43:17 PM: ​
5:43:17 PM: (Deploy site completed in 608ms)
5:43:17 PM: ​
5:43:17 PM: ────────────────────────────────────────────────────────────────
5:43:17 PM: Netlify Build Complete
5:43:17 PM: ────────────────────────────────────────────────────────────────
5:43:17 PM: ​
5:43:17 PM: (Netlify Build completed in 30.7s)
5:43:17 PM: Starting post processing
5:43:17 PM: Post processing - HTML
5:43:17 PM: Caching artifacts
5:43:17 PM: Started saving node modules
5:43:17 PM: Finished saving node modules
5:43:17 PM: Processing form - contact
5:43:17 PM: Started saving build plugins
5:43:17 PM: Finished saving build plugins
5:43:17 PM: Started saving pip cache
5:43:17 PM: Detected form fields:
5:43:17 PM: - name
5:43:17 PM: - phone
5:43:17 PM: - comments
5:43:17 PM: Finished saving pip cache
5:43:17 PM: Started saving emacs cask dependencies
5:43:18 PM: Finished saving emacs cask dependencies
5:43:18 PM: Started saving maven dependencies
5:43:18 PM: Post processing - header rules
5:43:18 PM: Finished saving maven dependencies
5:43:18 PM: Started saving boot dependencies
5:43:18 PM: Post processing - redirect rules
5:43:18 PM: Finished saving boot dependencies
5:43:18 PM: Started saving rust rustup cache
5:43:18 PM: Finished saving rust rustup cache
5:43:18 PM: Post processing done
5:43:18 PM: Site is live :sparkles:
5:43:18 PM: Started saving go dependencies
5:43:19 PM: Finished saving go dependencies
5:43:19 PM: Build script success
5:45:21 PM: Finished processing build request in 3m26.251163221s

hi there,

seems like something might be out of date :thinking:

could you show us your package.json please?

Some packages are indeed out of date. But why would this problem happen only in the case of this repository but not in the original, identical one? I have tried updating the offending package, next, and naturally that created all sorts of other problems.

{
  "name": "mivotes",
  "scripts": {
    "dev": "next",
    "start": "next start",
    "build": "next build",
    "build:server": "NEXT_TARGET=server next build",
    "export:server": "NEXT_TARGET=server next export",
    "export": "npm run build:server && npm run export:server",
    "prod": "npm run export && npm run start:static",
    "start:static": "serve",
    "now-build": "next build",
    "test": "test",
    "gas": "webpack --config webpack-server.config.js",
    "dialog": "webpack --config webpack-dialog.config.js",
    "gasdeploy": "npm run gas && npx clasp push"
  },
  "keywords": [
    "react",
    "nextjs",
    "scrolling",
    "search"
  ],
  "license": "MIT",
  "dependencies": {
    "@material-ui/core": "4.1.1",
    "@material-ui/icons": "4.2.0",
    "@reach/router": "1.3.4",
    "emotion": "10.0.27",
    "hash-source": "1.0.4",
    "isomorphic-fetch": "^2.2.1",
    "lodash": "4.17.20",
    "lodash.template": ">=4.5.0",
    "next": "9.3.0",
    "next-offline": "^4.0.0",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-helmet": "5.2.0",
    "react-safe": "1.3.0",
    "react-select": "2.4.2",
    "styled-components": "5.2.0",
    "youtube-player": "5.5.2"
  },
  "devDependencies": {
    "@babel/core": "7.3.4",
    "@babel/preset-env": "^7.3.4",
    "@google/clasp": "^2.3.0",
    "@types/google-apps-script": "0.0.26",
    "babel-eslint": "10.1.0",
    "babel-loader": "^8.0.5",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
    "babel-plugin-transform-es3-property-literals": "^6.22.0",
    "babel-plugin-transform-object-assign": "^6.22.0",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "clean-webpack-plugin": "^0.1.19",
    "copy-webpack-plugin": "^4.5.2",
    "eslint": "7.4.0",
    "gas-lib": "^2.0.2",
    "gas-webpack-plugin": "^0.3.0",
    "html-webpack-inline-source-plugin": "0.0.10",
    "html-webpack-plugin": "^3.2.0",
    "serve": "11.3.2",
    "uglifyjs-webpack-plugin": "^2.2.0",
    "webpack-cli": "^4.2.0"
  }
}

Hiya @leftclicktwice . Pretty easy to see the difference in the build logs, which I expect explains the different behavior in the builds:

from jolly-blackwell-c29d31:

1:16:34 PM: Now using node v12.18.0 (npm v6.14.4)

from suspicious-goldstine-eb2ca5

5:42:39 PM: Now using node v10.24.1 (npm v6.14.12)

I suppose you haven’t seen or followed the advice in [Support Guide] Debugging Netlify site builds about being very explicit about setting all your versions for node, npm, etc, and you’d be well served to follow it. Sites created at different times on our service will have different defaults (based largely on what is current at the time) and we never change those defaults on all sites so the best practice is to be explicit in your configuration.

1 Like

Thanks, @fool. That makes sense. I set NODE_VERSION and NPM_VERSION but am still getting the same build error. I don’t think yarn is involved in this. Setting NODE_ENV to production didn’t help either. I’d rather not learn how to debug with Docker if that’s not necessary. Is that my next step? If the remedy requires more than setting versions of things to match those of the functioning site, then it’s very unlikely that I’ll be able to find out what that remedy is.

11:33:36 AM: Build ready to start
11:33:38 AM: build-image version: be42e453d6c8f171cc2f654acc29c0a8b60e6d93
11:33:38 AM: build-image tag: v3.7.1
11:33:38 AM: buildbot version: 7f6e791c87eb170e7c519e73c3c0a0eca9a85dfa
11:33:38 AM: Building without cache
11:33:38 AM: Starting to prepare the repo for build
11:33:39 AM: No cached dependencies found. Cloning fresh repo
11:33:39 AM: git clone https://github.com/dancancro/mivotes
11:33:43 AM: Preparing Git Reference refs/heads/master
11:33:45 AM: Starting build script
11:33:45 AM: Installing dependencies
11:33:45 AM: Python version set to 2.7
11:33:46 AM: Downloading and installing node v10.24.1...
11:33:47 AM: Downloading https://nodejs.org/dist/v10.24.1/node-v10.24.1-linux-x64.tar.xz...
11:33:47 AM: Computing checksum with sha256sum
11:33:47 AM: Checksums matched!
11:33:50 AM: Now using node v10.24.1 (npm v6.14.12)
11:33:50 AM: Started restoring cached build plugins
11:33:50 AM: Finished restoring cached build plugins
11:33:50 AM: Attempting ruby version 2.7.1, read from environment
11:33:51 AM: Using ruby version 2.7.1
11:33:52 AM: Using PHP version 5.6
11:33:52 AM: Started restoring cached node modules
11:33:52 AM: Finished restoring cached node modules
11:33:52 AM: Installing NPM modules using NPM version 6.14.12
11:34:25 AM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
11:34:25 AM: > core-js-pure@3.1.4 postinstall /opt/build/repo/node_modules/core-js-pure
11:34:25 AM: > node scripts/postinstall || echo "ignore"
11:34:28 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
11:34:28 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:34:28 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/webpack/node_modules/fsevents):
11:34:28 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:34:28 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/next/node_modules/fsevents):
11:34:28 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:34:28 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fork-ts-checker-webpack-plugin/node_modules/fsevents):
11:34:28 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:34:28 AM: added 1698 packages from 573 contributors and audited 1769 packages in 34.375s
11:34:29 AM: 37 packages are looking for funding
11:34:29 AM:   run `npm fund` for details
11:34:29 AM: found 16 vulnerabilities (4 low, 4 moderate, 8 high)
11:34:29 AM:   run `npm audit fix` to fix them, or `npm audit` for details
11:34:29 AM: NPM modules installed
11:34:30 AM: Started restoring cached go cache
11:34:30 AM: Finished restoring cached go cache
11:34:30 AM: go version go1.14.4 linux/amd64
11:34:30 AM: go version go1.14.4 linux/amd64
11:34:30 AM: Installing missing commands
11:34:30 AM: Verify run directory
11:34:32 AM: ​
11:34:32 AM: ────────────────────────────────────────────────────────────────
11:34:32 AM:   Netlify Build                                                 
11:34:32 AM: ────────────────────────────────────────────────────────────────
11:34:32 AM: ​
11:34:32 AM: ❯ Version
11:34:32 AM:   @netlify/build 10.2.7
11:34:32 AM: ​
11:34:32 AM: ❯ Flags
11:34:32 AM:   deployId: 6075b9d0689f4700d0f91901
11:34:32 AM: ​
11:34:32 AM: ❯ Current directory
11:34:32 AM:   /opt/build/repo
11:34:32 AM: ​
11:34:32 AM: ❯ Config file
11:34:32 AM:   /opt/build/repo/netlify.toml
11:34:32 AM: ​
11:34:32 AM: ❯ Context
11:34:32 AM:   production
11:34:32 AM: ​
11:34:32 AM: ❯ Installing plugins
11:34:32 AM:    - @netlify/plugin-nextjs@1.1.3
11:34:53 AM: ​
11:34:53 AM: ❯ Loading plugins
11:34:53 AM:    - @netlify/plugin-nextjs@1.1.3 from Netlify app
11:34:53 AM: ​
11:34:53 AM: ❯ Outdated plugins
11:34:53 AM:    - @netlify/plugin-nextjs@1.1.3: latest version is 3.0.3 which is incompatible with next@<10.0.6
11:34:53 AM: ​
11:34:53 AM: ────────────────────────────────────────────────────────────────
11:34:53 AM:   1. onPreBuild command from @netlify/plugin-nextjs             
11:34:53 AM: ────────────────────────────────────────────────────────────────
11:34:53 AM: ​
11:34:53 AM: ​
11:34:53 AM: ────────────────────────────────────────────────────────────────
11:34:53 AM:   Plugin "@netlify/plugin-nextjs" failed                        
11:34:53 AM: ────────────────────────────────────────────────────────────────
11:34:53 AM: ​
11:34:53 AM:   Error message
11:34:53 AM:   Error: Please upgrade to Next.js 9.5.3 or later
11:34:53 AM: ​
11:34:53 AM:   Plugin details
11:34:53 AM:   Package:        @netlify/plugin-nextjs
11:34:53 AM:   Version:        1.1.3
11:34:53 AM:   Repository:     git+https://github.com/netlify/netlify-plugin-nextjs.git
11:34:53 AM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-nextjs
11:34:53 AM:   Report issues:  https://github.com/netlify/netlify-plugin-nextjs/issues
11:34:53 AM: ​
11:34:53 AM:   Error location
11:34:53 AM:   In "onPreBuild" event in "@netlify/plugin-nextjs" from Netlify app
11:34:53 AM:       at validateNextUsage (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/helpers/validateNextUsage.js:18:12)
11:34:53 AM:       at onPreBuild (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/index.js:20:5)
11:34:53 AM: ​
11:34:53 AM:   Resolved config
11:34:53 AM:   build:
11:34:53 AM:     command: npm run export
11:34:53 AM:     commandOrigin: ui
11:34:53 AM:     environment:
11:34:53 AM:       - NODE_VERSION
11:34:53 AM:       - NPM_VERSION
11:34:53 AM:     publish: /opt/build/repo/out
11:34:53 AM:   plugins:
11:34:53 AM:     - inputs: {}
11:34:53 AM:       origin: ui
11:34:53 AM:       package: '@netlify/plugin-nextjs'
11:34:53 AM:   redirects:
11:34:53 AM:     - from: /service-worker.js
11:34:53 AM:       status: 200
11:34:53 AM:       to: /static/service-worker.js
11:34:54 AM: Caching artifacts
11:34:54 AM: Started saving node modules
11:34:54 AM: Finished saving node modules
11:34:54 AM: Started saving build plugins
11:34:54 AM: Finished saving build plugins
11:34:54 AM: Started saving pip cache
11:34:54 AM: Finished saving pip cache
11:34:54 AM: Started saving emacs cask dependencies
11:34:54 AM: Finished saving emacs cask dependencies
11:34:54 AM: Started saving maven dependencies
11:34:54 AM: Finished saving maven dependencies
11:34:54 AM: Started saving boot dependencies
11:34:54 AM: Finished saving boot dependencies
11:34:54 AM: Started saving rust rustup cache
11:34:54 AM: Finished saving rust rustup cache
11:34:54 AM: Started saving go dependencies
11:34:54 AM: Finished saving go dependencies
11:34:57 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:34:57 AM: Creating deploy upload records
11:34:57 AM: Failing build: Failed to build site
11:34:57 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:34:58 AM: Finished processing build request in 1m19.378339497s

Hey there! I just wanna re-iterate what @perry shared initially here. It looks like you need to update your version of Next.js, per this line:

'11:34:53 AM: Error: Please upgrade to Next.js 9.5.3 or later'

You’re not wrong. But I tried that and got a different error that I can’t solve either. So I’m stuck in both cases. Since the original application is building successfully, I wager that chances are better that I can solve this problem with this identical application.

I have asked the Next forum for help solving the Next upgrade problem, but none has been provided

What do you personally do when you are faced with a problem that you cannot solve and the communities cannot solve? This is a broader question than this instance. I am honestly interested. I haven’t held a paid job in this field for decades because situations like this still come up. If a company depended on such problems being solved by someone with my skill level, it would simply go out of business. Companies are not going out of business, so that means their staff must have skill levels above mine. So what do you do to solve 100% of the problems you face?

It’s a good question – we can’t solve everything! Today, for example, I’ve had to signpost other customers to Hugo, some to the Next.js team, others to Postgres support avenues. We’re pretty alright at supporting Netlify and our infrastructure… it gets tricky when there’s a few different chefs.

I hope that the Next.js team can help in this case!

1 Like