Nextjs deployment issues - 404 on _next/* requests

Hi,

I’m trying to migrate my application to Nextjs, but I’m unable to have the application deployed successfully on Netlify. To make the context clear. I have an app already deployed (based on CRA) and on a PR I’m trying to see whether I can deploy from my PR before changing the main build

You can find the deployed app here.

All calls to static content fail. If I remove the _next from the URL, I can see the static content. If I download the generated build, I can see there are no next folder.

From the build I can see the following

11:28:40 PM: Netlify configuration property "redirects" value changed to [
11:28:40 PM:   { from: '/_next/static/*', to: '/static/:splat', status: 200 },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/image*',
11:28:40 PM:     query: { url: ':url', w: ':width', q: ':quality' },
11:28:40 PM:     to: '/_ipx/w_:width,q_:quality/:url',
11:28:40 PM:     status: 301
11:28:40 PM:   },

At the top of the build page, I see

No redirect rules processed

So it seems the redirect rules are not applied, but there are no errors in the build log.

Do you have any idea of what’s wrong?

Hi @Nebulis ,

It looks like something in your code may have changed between the last working deploy preview on March 24th https://deploy-preview-1110--dapp-development-bluejay.netlify.app/ and recent deploys. Could you compare the code between the working deploy with the current ones to see if you can narrow down where changes were made that affected the deployed site behavior?

Hi,

My last successful deployment was using create react app. This is a WIP migration to NextJS, so a huge part of the code changed (actually mostly things related to routing and images).

Locally, I can run next dev, next build, and next start without any issues. I’m trying to understand what could be wrong with my netlify deployment configuration.

Can you check where these files redirect are located in your repo?

I don’t have this in my repo. I changed the runtime to NextJs. This the the output of the next js plugin which is triggered right after the build

11:28:39 PM:   3. @netlify/plugin-nextjs (onBuild event)                     
11:28:39 PM: ────────────────────────────────────────────────────────────────
11:28:39 PM: ​
11:28:39 PM: Patching /opt/build/repo/node_modules/next/dist/server/base-server.js
11:28:39 PM: Done
11:28:39 PM: Patching /opt/build/repo/node_modules/next/dist/server/next-server.js
11:28:39 PM: Done
11:28:39 PM: Moving static page files to serve from CDN...
11:28:40 PM: Moved 13 files
11:28:40 PM: You are not using Netlify Edge Functions for image format detection. Set env var "NEXT_FORCE_EDGE_IMAGES=true" to enable.
11:28:40 PM: Netlify configuration property "redirects" value changed to [
11:28:40 PM:   { from: '/_next/static/*', to: '/static/:splat', status: 200 },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/image*',
11:28:40 PM:     query: { url: ':url', w: ':width', q: ':quality' },
11:28:40 PM:     to: '/_ipx/w_:width,q_:quality/:url',
11:28:40 PM:     status: 301
11:28:40 PM:   },
11:28:40 PM:   { from: '/_ipx/*', to: '/.netlify/builders/_ipx', status: 200 },
11:28:40 PM:   { from: '/cache/*', to: '/404.html', status: 404, force: true },
11:28:40 PM:   { from: '/server/*', to: '/404.html', status: 404, force: true },
11:28:40 PM:   { from: '/serverless/*', to: '/404.html', status: 404, force: true },
11:28:40 PM:   { from: '/trace', to: '/404.html', status: 404, force: true },
11:28:40 PM:   { from: '/traces', to: '/404.html', status: 404, force: true },
11:28:40 PM:   {
11:28:40 PM:     from: '/routes-manifest.json',
11:28:40 PM:     to: '/404.html',
11:28:40 PM:     status: 404,
11:28:40 PM:     force: true
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/build-manifest.json',
11:28:40 PM:     to: '/404.html',
11:28:40 PM:     status: 404,
11:28:40 PM:     force: true
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/prerender-manifest.json',
11:28:40 PM:     to: '/404.html',
11:28:40 PM:     status: 404,
11:28:40 PM:     force: true
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/react-loadable-manifest.json',
11:28:40 PM:     to: '/404.html',
11:28:40 PM:     status: 404,
11:28:40 PM:     force: true
11:28:40 PM:   },
11:28:40 PM:   { from: '/BUILD_ID', to: '/404.html', status: 404, force: true },
11:28:40 PM:   {
11:28:40 PM:     from: '/api/*',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/android-chrome-192x192.png',
11:28:40 PM:     to: '/android-chrome-192x192.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/apple-touch-icon.png',
11:28:40 PM:     to: '/apple-touch-icon.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/favicon-32x32.png',
11:28:40 PM:     to: '/favicon-32x32.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/favicon.ico',
11:28:40 PM:     to: '/favicon.ico',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/manifest.json',
11:28:40 PM:     to: '/manifest.json',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/netlify.toml',
11:28:40 PM:     to: '/netlify.toml',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/robots.txt',
11:28:40 PM:     to: '/robots.txt',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/sitemap.xml',
11:28:40 PM:     to: '/sitemap.xml',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/social.jpeg',
11:28:40 PM:     to: '/social.jpeg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/coins-stacked.svg',
11:28:40 PM:     to: '/images/earn/coins-stacked.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/invest-globally.svg',
11:28:40 PM:     to: '/images/earn/invest-globally.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/lending-icon.svg',
11:28:40 PM:     to: '/images/earn/lending-icon.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/lock-closed.svg',
11:28:40 PM:     to: '/images/earn/lock-closed.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/lock-open.svg',
11:28:40 PM:     to: '/images/earn/lock-open.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/menu-lends-icon.svg',
11:28:40 PM:     to: '/images/earn/menu-lends-icon.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/money-bank.svg',
11:28:40 PM:     to: '/images/earn/money-bank.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/money-chest.svg',
11:28:40 PM:     to: '/images/earn/money-chest.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/moneybag.svg',
11:28:40 PM:     to: '/images/earn/moneybag.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/new-opportunities.svg',
11:28:40 PM:     to: '/images/earn/new-opportunities.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/passive-income.png',
11:28:40 PM:     to: '/images/earn/passive-income.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/earn/sad.svg',
11:28:40 PM:     to: '/images/earn/sad.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/blu-dai.png',
11:28:40 PM:     to: '/images/shared/blu-dai.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/blu.png',
11:28:40 PM:     to: '/images/shared/blu.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/dai.png',
11:28:40 PM:     to: '/images/shared/dai.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/gnosis-safe.png',
11:28:40 PM:     to: '/images/shared/gnosis-safe.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/logo-text.svg',
11:28:40 PM:     to: '/images/shared/logo-text.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/logo.svg',
11:28:40 PM:     to: '/images/shared/logo.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/metamask.svg',
11:28:40 PM:     to: '/images/shared/metamask.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/sgd-dai.png',
11:28:40 PM:     to: '/images/shared/sgd-dai.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/sgd.png',
11:28:40 PM:     to: '/images/shared/sgd.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/uniswap.png',
11:28:40 PM:     to: '/images/shared/uniswap.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/uniswap.svg',
11:28:40 PM:     to: '/images/shared/uniswap.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/wallet-connect.svg',
11:28:40 PM:     to: '/images/shared/wallet-connect.svg',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/images/shared/xsgd.png',
11:28:40 PM:     to: '/images/shared/xsgd.png',
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     status: 200
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/*',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     conditions: { Cookie: [Array] },
11:28:40 PM:     force: true
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/index.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/bonds.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/bonds',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/bonds/stabilizing/dai-sgd.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/bonds/stabilizing/dai-sgd',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/cblu.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/cblu',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/earn.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/earn',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/faucet.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/faucet',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/pblu.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/pblu',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/poolfactory.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/poolfactory',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/staking.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/staking',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/swap/psm.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/swap/psm',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/swap/uniswap.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/swap/uniswap',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/system.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/system',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/testing.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/testing',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/bonds/treasury/:bondType.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/bonds/treasury/:bondType',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/borrower/:loanPoolAddress.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/borrower/:loanPoolAddress',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/earn/:loanPoolAddress.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/earn/:loanPoolAddress',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/_next/data/TuNcHNqcTWet-lG8zeI1x/swap/uniswap/:tokenInputAddress/:tokenOutputAddress.json',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/swap/uniswap/:tokenInputAddress/:tokenOutputAddress',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200,
11:28:40 PM:     force: false
11:28:40 PM:   },
11:28:40 PM:   {
11:28:40 PM:     from: '/*',
11:28:40 PM:     to: '/.netlify/functions/___netlify-handler',
11:28:40 PM:     status: 200
11:28:40 PM:   }
11:28:40 PM: ].
11:28:40 PM: ​
11:28:40 PM: (@netlify/plugin-nextjs onBuild completed in 119ms)

I have one netlify.toml, but no redirects inside. Here is the content:

[[plugins]]
package = "@netlify/plugin-nextjs"

[[headers]]
  for = "/manifest.json"
  [headers.values]
    Access-Control-Allow-Origin = "*"

[[headers]]
  for = "/*"
  [headers.values]
    Content-Security-Policy = "default-src 'self';"
    Content-Security-Policy = "script-src-elem https://netlify-cdp-loader.netlify.app/netlify.js https://www.googletagmanager.com/gtag/js"
    Content-Security-Policy = "connect-src https://eth-goerli.g.alchemy.com https://eth-mainnet.g.alchemy.com https://*.google-analytics.com https://lend-metadata.s3.ap-southeast-1.amazonaws.com https://lend-metadata-production.s3.ap-southeast-1.amazonaws.com https://api.coingecko.com wss://*.bridge.walletconnect.org https://registry.walletconnect.com https://mainnet.infura.io"

I added the plugin section to try as I found some posts mentioning it, but it didn’t change anything.
In case it helps here are the build settings:

Runtime: Next.js
Base directory: Not set
Build command: lerna bootstrap && lerna run build --scope "'@bluejayfinance/contracts'" && lerna run build --scope "'@bluejayfinance/dapp'"
Publish directory: packages/dapp/.next
Build status: Active

lerna run build --scope "'@bluejayfinance/dapp runs next build

I think this was your last build in attempting to get this to work, correct? Netlify App

If so, I can see that we are not loading the next-runtime, so the build can never work as you’re desiring. Our autodetection is probably being thwarted by your lerna setup.

So - could you try explicitly turning it on, by adding the next-runtime as a dependency in your package.json? (cf Build Plugins | Netlify Docs) Once you do, you’ll start seeing that the next-runtime plugin is used on your site in the build logs during the step just before you see “Build command from Netlify app” (that line is present in every build log):

❯ Using Next.js Runtime - v4.33.0

Hi;

I switched to next export temporarily. To make it work, I disabled the next-runtime, that’s why it doesn’t appear in the build you shared.

This is my last attempt with the next runtime, which was explicitly enabled through the UI. I was able to see it running at different steps of the build.