-
Notifications
You must be signed in to change notification settings - Fork 86
[Bug]: Cannot find module 'next/dist/build/analysis/extract-const-value' #1690
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
It's happening in my project too. Any help is welcome |
@gfirem I've managed to resolve this by upgrading our node packages. We are now using next 12.3.1 + react 18.2.0 and builds are resuming. |
this worked for me as well. thanks! |
this also worked for me! |
Thanks😄, Only updated "nextjs" and it worked for me, next 11.1.0(😅) -> 12.3.1 |
Thanks for this! I am using React version 17.0.2, and only updating Next from 12.1.0 to 12.3.1 has solved it for me! 🥳 |
Thanks for the report. The workaround is to upgrade Next.js, but I will put out a fix to work wiht older versions today. |
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
A link to a reproduction repository
No response
Next Runtime version
4.27.0
More information about your build
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
Function logs
Function logs
.next JSON files
generated .next JSON files
The text was updated successfully, but these errors were encountered: