Hi,
I’m currently getting the following error:
9:57:47 AM: Error location
9:57:47 AM: In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app
9:57:47 AM: at async Promise.all (index 1)
And this is simply because I’m having the Next.js plugin enabled in the Netlify UI according to the rest of the log. But the problem is, when I go to the Integrations tab, I can’t see the Next.js plugin anymore? So how can I disable it then?
Gr,
Andy
Melvin
August 12, 2024, 1:19pm
2
Hi @andylemaire ,
Thanks for reaching out! Sorry to hear about this issue.
Could you share a deploy log where you are seeing this issue? This will help us investigate the issue.
9:57:11 AM: Netlify Build
9:57:11 AM: ────────────────────────────────────────────────────────────────
9:57:11 AM:
9:57:11 AM: ❯ Version
9:57:11 AM: @netlify/build 29.53.0
9:57:11 AM:
9:57:11 AM: ❯ Flags
9:57:11 AM: accountId: 5b31ea3dfdd72a7263d299e4
9:57:11 AM: baseRelDir: true
9:57:11 AM: buildId: 66b9c038edd9740008dccb89
9:57:11 AM: deployId: 66b9c038edd9740008dccb8b
9:57:11 AM:
9:57:11 AM: ❯ Current directory
9:57:11 AM: /opt/build/repo
9:57:11 AM:
9:57:11 AM: ❯ Config file
9:57:11 AM: /opt/build/repo/netlify.toml
9:57:11 AM:
9:57:11 AM: ❯ Context
9:57:11 AM: production
9:57:11 AM:
9:57:11 AM: ❯ Installing plugins
9:57:11 AM: - @netlify/plugin-nextjs@5.6.0
9:57:11 AM: - @netlify/plugin-lighthouse@6.0.0
9:57:20 AM:
9:57:20 AM: ❯ Using Next.js Runtime - v5.6.0
9:57:20 AM:
9:57:20 AM: ❯ Loading plugins
9:57:20 AM: - @netlify/plugin-lighthouse@6.0.0 from netlify.toml
9:57:22 AM: Next.js cache restored
9:57:22 AM:
9:57:22 AM: build.command from netlify.toml
9:57:22 AM: ────────────────────────────────────────────────────────────────
9:57:22 AM:
9:57:22 AM: $ CI= npm run build
9:57:22 AM: > ddvdrivertraining@1.0.0 prebuild
9:57:22 AM: > npm run i18n
9:57:22 AM: > ddvdrivertraining@1.0.0 i18n
9:57:22 AM: > formatjs compile-folder --ast --format simple ./src/content/locales ./src/content/compiled-locales
9:57:23 AM: > ddvdrivertraining@1.0.0 build
9:57:23 AM: > next build
9:57:23 AM: Browserslist: caniuse-lite is outdated. Please run:
9:57:23 AM: npx browserslist@latest --update-db
9:57:23 AM: Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
9:57:23 AM: Linting and checking validity of types ...
9:57:25 AM: Browserslist: caniuse-lite is outdated. Please run:
9:57:25 AM: npx browserslist@latest --update-db
9:57:25 AM: Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
9:57:26 AM: Creating an optimized production build ...
9:57:26 AM: Disabled SWC as replacement for Babel because of custom Babel configuration "babel.config.json" https://nextjs.org/docs/messages/swc-disabled
9:57:27 AM: ✓ Compiled successfully
9:57:27 AM: Collecting page data ...
9:57:28 AM: Generating static pages (0/14) ...
9:57:29 AM: Generating static pages (3/14)
9:57:29 AM: Generating static pages (6/14)
9:57:29 AM: Generating static pages (10/14)
9:57:29 AM: ✓ Generating static pages (14/14)
9:57:30 AM: Finalizing page optimization ...
9:57:30 AM: Collecting build traces ...
9:57:47 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:57:47 AM: Route (pages) Size First Load JS
9:57:47 AM: ┌ ○ / (916 ms) 1.29 kB 155 kB
9:57:47 AM: ├ /_app 0 B 114 kB
9:57:47 AM: ├ ○ /404 (899 ms) 2.22 kB 119 kB
9:57:47 AM: ├ ○ /500 (701 ms) 2.22 kB 119 kB
9:57:47 AM: ├ ○ /about (898 ms) 2.54 kB 128 kB
9:57:47 AM: ├ ○ /contact (820 ms) 468 B 151 kB
9:57:47 AM: ├ ○ /contact/success (896 ms) 2.02 kB 124 kB
9:57:47 AM: └ ○ /offline (843 ms) 1.46 kB 119 kB
9:57:47 AM: + First Load JS shared by all 138 kB
9:57:47 AM: ├ chunks/framework-0c7baedefba6b077.js 45.4 kB
9:57:47 AM: ├ chunks/main-c446eb7289e66657.js 40.5 kB
9:57:47 AM: ├ chunks/pages/_app-54714693e5b15e13.js 25.8 kB
9:57:47 AM: ├ chunks/webpack-ab9805bb5f289ac9.js 1.89 kB
9:57:47 AM: └ css/846fe584fadb7c23.css 24.1 kB
9:57:47 AM: ○ (Static) automatically rendered as static HTML (uses no initial props)
9:57:47 AM: > ddvdrivertraining@1.0.0 postbuild
9:57:47 AM: > next-sitemap
9:57:47 AM: ✨ [next-sitemap] Loading next-sitemap config: file:///opt/build/repo/next-sitemap.config.js
9:57:47 AM: ✅ [next-sitemap] Generation completed
9:57:47 AM: ┌───────────────┬────────┐
9:57:47 AM: │ (index) │ Values │
9:57:47 AM: ├───────────────┼────────┤
9:57:47 AM: │ indexSitemaps │ 1 │
9:57:47 AM: │ sitemaps │ 1 │
9:57:47 AM: └───────────────┴────────┘
9:57:47 AM: -----------------------------------------------------
9:57:47 AM: SITEMAP INDICES
9:57:47 AM: -----------------------------------------------------
9:57:47 AM: ○ https://dev.ddvdrivertraining.be/sitemap.xml
9:57:47 AM: -----------------------------------------------------
9:57:47 AM: SITEMAPS
9:57:47 AM: -----------------------------------------------------
9:57:47 AM: ○ https://dev.ddvdrivertraining.be/sitemap-0.xml
9:57:47 AM:
9:57:47 AM: (build.command completed in 24.7s)
9:57:47 AM: Next.js cache saved
9:57:47 AM:
9:57:47 AM: Plugin "@netlify/plugin-nextjs" failed
9:57:47 AM: ────────────────────────────────────────────────────────────────
9:57:47 AM:
9:57:47 AM: Error message
9:57:47 AM: Error: Failed assembling static pages for upload
9:57:47 AM: @netlify/plugin-nextjs@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.
9:57:47 AM:
9:57:47 AM: Plugin details
9:57:47 AM: Package: @netlify/plugin-nextjs
9:57:47 AM: Version: 5.6.0
9:57:47 AM: Repository: git+https://github.com/netlify/next-runtime.git
9:57:47 AM: npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs
9:57:47 AM: Report issues: https://github.com/netlify/next-runtime/issues
9:57:47 AM:
9:57:47 AM: Error location
9:57:47 AM: In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app
9:57:47 AM: at async Promise.all (index 1)
9:57:47 AM:
9:57:47 AM: Resolved config
9:57:47 AM: build:
9:57:47 AM: base: /opt/build/repo
9:57:47 AM: command: CI= npm run build
9:57:47 AM: commandOrigin: config
9:57:47 AM: environment:
9:57:47 AM: - NODE_VERSION
9:57:47 AM: - GOOGLE_TAG_MANAGER_ID
9:57:47 AM: - SITE_URL
9:57:47 AM: publish: /opt/build/repo/.next
9:57:47 AM: publishOrigin: config
9:57:47 AM: headers:
9:57:47 AM: - for: /
9:57:47 AM: values:
9:57:47 AM: Link: <https://fonts.googleapis.com>; rel=preconnect; crossorigin, <https://fonts.gstatic.com>; rel=preconnect; crossorigin
9:57:47 AM: - for: /*
values:
Content-Security-Policy: default-src 'self'; connect-src 'self' *.google-analytics.com *.contentful.com *.googleapis.com *.prismic.io; font-src 'self' *.googleapis.com *.gstatic.com; img-src * data:; manifest-src 'self' *.netlify.com; script-src 'self'; script-src-elem 'self' 'unsafe-inline' *.google-analytics.com *.googletagmanager.com *.hotjar.com; style-src 'self' 'unsafe-inline' *.googleapis.com; report-uri https://andylemaire.report-uri.com/r/d/csp/wizard; report-to default
NEL: '{''report_to'':''default'', ''max_age'':31536000, ''include_subdomains'':true}'
Permissions-Policy: geolocation=(self), microphone=()
Referrer-Policy: strict-origin-when-cross-origin
Report-To: '{''group'':''default'', ''max_age'':31536000, ''endpoints'':[{''url'':''https://andylemaire.report-uri.com/a/d/g''}], ''include_subdomains'':true}'
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block; report=https://andylemaire.report-uri.com/r/d/xss/enforce
cache-control: public, max-age=31536000
headersOrigin: config
plugins:
- inputs: {}
origin: ui
package: '@netlify/plugin-nextjs'
- inputs: {}
origin: config
package: '@netlify/plugin-lighthouse'
redirects:
- force: true
from: https://ddvdrivertraining.netlify.app/*
status: 301
to: https://www.ddvdrivertraining.be/:splat
- force: true
from: https://dev-ddvdrivertraining.netlify.app/*
status: 301
to: https://dev.ddvdrivertraining.be/:splat
redirectsOrigin: config
9:57:47 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:57:47 AM: Failing build: Failed to build site
9:57:48 AM: Finished processing build request in 56.471s
10:56:19 AM: [ERROR] Deploy logs are currently unavailable. We are working on resolving the issue.
Melvin
August 13, 2024, 2:18pm
4
Hi @andylemaire ,
Thanks for following up. I was able to find the site and see this error in the build log:
You’ll want to follow our docs here:
Learn about Next.js on our platform. Use App Router, automatic fine-grained caching, image optimization, and more with Next.js 13.5+ on Netlify.
Note there is a section on disabling the build failure:
Disabling the build failure if necessary
If you believe that a check failure is incorrect or would like to defer handling the issue to a later time, you can skip this check via an environment variable.
Add a new environment variable NETLIFY_NEXT_VERIFY_FORMS
to your site, and give it the value false
.
Could you read over the docs to troubleshoot this issue?
@Melvin I’m getting the same issue on Site ID 02ea3d7d-d9b8-4dcd-83d2-f388913b69eb even with the env variable set to false?
Melvin
August 26, 2024, 2:59pm
6
Hi @andylemaire ,
Thanks for following up. I’m not seeing any environment variables here:
Could you clarify where you’ve added the environment variable?
Hi @Melvin , they’re in the netlify.toml file
Melvin
August 27, 2024, 1:04pm
8
Hi @andylemaire ,
I see it in your latest deploy in the netlify.toml, the latest deploy was successful. Were you able to resolve the issue? Or did you try something else?
Hi, no it’s not showing when deployed.
It finally works, but I have no clue why…