Skip to content

[Bug]: Cannot find module 'next/dist/build/analysis/extract-const-value' #1690

Closed
@stwilz

Description

@stwilz

Summary

Hey there,

We just ran a deploy after the latest plugin release and we are getting the following issue.

Error: Cannot find module 'next/dist/build/analysis/extract-const-value'
Require stack:

/opt/build/repo/web/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/helpers/analysis.js
/opt/build/repo/web/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/helpers/functions.js
/opt/build/repo/web/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/index.js
While loading "@netlify/plugin-nextjs" from Netlify app at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15) at Function.Module._load (node:internal/modules/cjs/loader:833:27) at Module.require (node:internal/modules/cjs/loader:1057:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/opt/build/repo/web/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/helpers/analysis.js:28:31) at Module._compile (node:internal/modules/cjs/loader:1155:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10) at Module.load (node:internal/modules/cjs/loader:1033:32) at Function.Module._load (node:internal/modules/cjs/loader:868:12) at Module.require (node:internal/modules/cjs/loader:1057:19)

Error properties: { code: 'MODULE_NOT_FOUND' }

Steps to reproduce

  1. Trigger Build

A link to a reproduction repository

No response

Next Runtime version

4.27.0

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

No response

Your netlify.toml file

[build]
base = "/web/"
publish = ".next"
command = "yarn build"

Your public/_redirects file

No response

Your next.config.js file

// const { withSentryConfig } = require('@sentry/nextjs')

/** @type {import('next').NextConfig} /
const nextConfig = {
reactStrictMode: true,
images: {
domains: ['cdn.sanity.io'],
deviceSizes: [768, 1280, 1440, 1700],
imageSizes: [45, 375, 710],
},
redirects: async () => [
{
source: '/',
has: [
{
type: 'cookie',
key: 'centreSlug',
value: '(?.
)',
},
],
destination: '/:centreSlug',
permanent: false,
},
{
source: '/',
destination: '/intro',
permanent: false,
},
],
}
module.exports = nextConfig

Builds logs (or link to your logs)

Build logs
# Paste logs here

Function logs

Function logs
# Paste logs here

.next JSON files

generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions