-
Notifications
You must be signed in to change notification settings - Fork 86
Build Error - Plugin "@netlify/plugin-nextjs" internal error #2024
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
Comments
We're seeing the same issue with the release of plugin version 4.33.0. Our dev environment is failing with code that deployed successfully on Wednesday 3/29:
Comparing to the output from last week, this is the most obvious difference I see:
vs. previous build:
|
@joeluna17 @daverodriguez aside from using the latest version of the plugin, have you updated Next.js recently? |
@nickytonline Same thing is happening to us. Upgraded to Next v13 about 4 weeks ago and haven't touched it since (Using yarn pnp). Started seeing builds failing March 29th at 9:40am PT. Last successful build was March 28th at 3:09pm PT. |
hi @joeluna17, could you please let me know if you are using a monorepo setup? if so, it would very useful to know your tooling setup, folder structure and netlify.toml setup. thanks! |
@nickytonline No, our Next.js version has been stable since December of last year. |
Some additional information that might be helpful to us to narrow down where the issue was introduced: What versions of |
Last successful build on March 28th at 3:09pm PT:
First build error on March 29th at 9:40am PT:
|
Could you try adding
to Above canary was build with those changes https://github.com/netlify/next-runtime/compare/lazy-import-server Edit: you might also use above devDependencies technique to downgrade to |
@pieh I'm running into the same issue on my nextjs deploys as well. Used to work and not getting this same error. I tried adding the plugin explicitly using the specific version you listed but that did not work. I also tried to ddowngrade to |
local builds ( I've downgraded back to Next.js v13.1.6 and everything is back to normal working conditions. |
I also started getting an issue as soon as I upgraded my repo to Next 13.3 and |
I am using NX monorepo and the folder structure is as follows : apps (root) -> app1 , app2, app3... |
@KrustyC I was not able to reproduce problems with your reproduction when going back to Next 13.3 and
Can you provide settings that you used in GUI? I did try to replicate it with some basic NX setup, but all of my test deploys that I could think of were successful |
@pieh thanks for giving it a go. Have you tried building the app with |
@KrustyC I was using I do see an error related to edge function packaging, but this is not related to |
I finally managed to solve the issue, which also solved an issue with my Middleware not running. I am not sure it is ideal, but it works fine in my case: all I had to do was to add |
@KrustyC glad that's got you a working build. if you want to continue trying to resolve it, i'd recommend adding a TOML file that |
@orinokai I am not sure which folder I should |
I have the same issue. Looks like a When I downgraded the netlify plugin, I saw more telling output:
|
@levino unfortunately Yarn PnP doesn't play well with build plugins (see notes in https://docs.netlify.com/configure-builds/manage-dependencies/#yarn ) For cases other than Yarn PnP and I did find a way to reproduce the problem finally and above fixed my reproduction and with changes from #2059 was able to successfully build and serve the site If you are willing to test those changes - please try adding following
to |
i have the same errors too, how did you solve it, i can't understand the website been deployed but all the sudden it stop |
Pushed new code and during deployment I'm receiving and error from the plugin. This worked last for me on 3/18/2023. I've tried deselecting the plugin from runtime, and then reselecting then recaching and redeploying with no luck. Below is the error output.
4:02:29 PM: build-image version: 6c82004ef0368b3a0232c6837cead23188bb347e (focal)
4:02:29 PM: buildbot version: 0dfbdb6e6e614fd26450cfc6bacb47c4c6fd9626
4:02:29 PM: Building without cache
4:02:29 PM: Starting to prepare the repo for build
4:02:29 PM: No cached dependencies found. Cloning fresh repo
4:02:29 PM: git clone --filter=blob:none [email protected]:joelunaGetCheckApp/check-forms-app
4:02:30 PM: Preparing Git Reference refs/heads/main
4:02:32 PM: Parsing package.json dependencies
4:02:33 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: 'apps' versus 'apps/' in the Netlify UI
4:02:33 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'dist/apps/check-payments-marketing/.next' versus '../dist/apps/check-payments-marketing/.next' in the Netlify UI
4:02:33 PM: Starting to install dependencies
4:02:33 PM: Python version set to 3.8
4:02:33 PM: Started restoring cached go cache
4:02:33 PM: Finished restoring cached go cache
4:02:33 PM: Installing Go version 1.19.5 (requested 1.19.5)
4:02:38 PM: go version go1.19.5 linux/amd64
4:02:38 PM: Using PHP version 8.0
4:02:38 PM: v16.20.0 is already installed.
4:02:38 PM: Now using node v16.20.0 (npm v8.19.4)
4:02:39 PM: Enabling Node.js Corepack
4:02:39 PM: Started restoring cached build plugins
4:02:39 PM: Finished restoring cached build plugins
4:02:39 PM: Attempting Ruby version 2.7.2, read from environment
4:02:39 PM: Using Ruby version 2.7.2
4:02:40 PM: Install dependencies script success
4:02:40 PM: Starting build script
4:02:40 PM: Using stage install dependencies
4:02:41 PM: Detected 2 framework(s)
4:02:41 PM: "next-nx" at version "unknown"
4:02:41 PM: "create-react-app" at version "unknown"
4:02:41 PM: Section completed: initializing
4:02:42 PM:
4:02:42 PM: Netlify Build
4:02:42 PM: ────────────────────────────────────────────────────────────────
4:02:42 PM:
4:02:42 PM: ❯ Version
4:02:42 PM: @netlify/build 29.9.0
4:02:42 PM:
4:02:42 PM: ❯ Flags
4:02:42 PM: baseRelDir: true
4:02:42 PM: buildId: 6429ed5ef88833550b63cea1
4:02:42 PM: deployId: 6429ed5ef88833550b63cea3
4:02:42 PM:
4:02:42 PM: ❯ Current directory
4:02:42 PM: /opt/build/repo/apps
4:02:42 PM:
4:02:42 PM: ❯ Config file
4:02:42 PM: No config file was defined: using default values.
4:02:42 PM:
4:02:42 PM: ❯ Context
4:02:42 PM: production
4:02:42 PM:
4:02:42 PM: ❯ Installing plugins
4:02:42 PM: - @netlify/[email protected]
4:02:53 PM:
4:02:53 PM: ❯ Using Next.js Runtime - v4.33.0
4:02:54 PM:
4:02:54 PM: Plugin "@netlify/plugin-nextjs" internal error
4:02:54 PM: ────────────────────────────────────────────────────────────────
4:02:54 PM:
4:02:54 PM: Error message
4:02:54 PM: Could not import plugin:
4:02:54 PM: Error: Could not find Next.js server
4:02:54 PM:
4:02:54 PM: Plugin details
4:02:54 PM: Package: @netlify/plugin-nextjs
4:02:54 PM: Version: 4.33.0
4:02:54 PM: Repository: git+https://github.com/netlify/next-runtime.git
4:02:54 PM: npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs
4:02:54 PM: Report issues: https://github.com/netlify/next-runtime/issues
4:02:54 PM:
4:02:54 PM: Error location
4:02:54 PM: While loading "@netlify/plugin-nextjs" from Netlify app
4:02:54 PM: at getNextServer (/opt/build/repo/apps/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/templates/handlerUtils.js:169:19)
4:02:54 PM: at Object. (/opt/build/repo/apps/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/templates/server.js:5:53)
4:02:54 PM: at Module._compile (node:internal/modules/cjs/loader:1196:14)
4:02:54 PM: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
4:02:54 PM: at Module.load (node:internal/modules/cjs/loader:1074:32)
4:02:54 PM: at Function.Module._load (node:internal/modules/cjs/loader:909:12)
4:02:54 PM: at Module.require (node:internal/modules/cjs/loader:1098:19)
4:02:54 PM: at require (node:internal/modules/cjs/helpers:108:18)
4:02:54 PM: at Object. (/opt/build/repo/apps/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/templates/getHandler.js:14:31)
4:02:54 PM: at Module._compile (node:internal/modules/cjs/loader:1196:14)
4:02:54 PM:
4:02:54 PM: Resolved config
4:02:54 PM: build:
4:02:54 PM: base: /opt/build/repo/apps
4:02:54 PM: command: npm i -g nx@latest && npm i && npm run build check-payments-marketing --configuration=production
4:02:54 PM: commandOrigin: ui
4:02:54 PM: environment:
4:02:54 PM: - NEXT_PUBLIC_MAIL_SERVICE_URL
4:02:54 PM: publish: /opt/build/repo/dist/apps/check-payments-marketing/.next
4:02:54 PM: publishOrigin: ui
4:02:54 PM: plugins:
4:02:54 PM: - inputs: {}
4:02:54 PM: origin: ui
4:02:54 PM: package: '@netlify/plugin-nextjs'
4:02:55 PM: Caching artifacts
4:02:55 PM: Started saving build plugins
4:02:55 PM: Finished saving build plugins
4:02:56 PM: Failed during stage 'building site': Build script returned non-zero exit code: 3 (https://ntl.fyi/exit-code-3)
4:02:55 PM: Started saving pip cache
4:02:55 PM: Finished saving pip cache
4:02:55 PM: Started saving emacs cask dependencies
4:02:55 PM: Finished saving emacs cask dependencies
4:02:55 PM: Started saving maven dependencies
4:02:55 PM: Finished saving maven dependencies
4:02:55 PM: Started saving boot dependencies
4:02:55 PM: Finished saving boot dependencies
4:02:55 PM: Started saving rust rustup cache
4:02:55 PM: Finished saving rust rustup cache
4:02:55 PM: Started saving go dependencies
4:02:55 PM: Finished saving go dependencies
4:02:56 PM: Build failed due to a plugin error: Build script returned non-zero exit code: 3
4:02:56 PM: Failing build: Failed to build site
4:02:56 PM: Finished processing build request in 27.342s
The text was updated successfully, but these errors were encountered: