Unable to build app in 12.0.1 with concurrentFeatures enabled
See original GitHub issueWhat version of Next.js are you using?
Attempted: v12.0
., v12.0.2-canary.2
and v12.0.2-canary.11
What version of Node.js are you using?
Attempted: node/14.18.1 and node/16.13.0
What browser are you using?
Chrome (N/A)
What operating system are you using?
macOS Monterey
How are you deploying your application?
Vercel
Describe the Bug
When updating from v12.0.0 to v12.0.1 it broke next build
and next dev’.
next lint` still works
Looking into the canary versioned packages: “12.0.1-canary.0” - WORKS “v12.0.1-canary.1” - DOES NOT WORK
So it could possibly be: #30299
next build output:
> next build
warn - You have enabled experimental feature(s).
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
warn - SWC minify beta enabled. https://nextjs.org/docs/messages/swc-minify-enabled
info - Checking validity of types
info - Using the createRoot API for React
warn - You are using an unsupported prerelease of 'react-dom' which may cause unexpected or broken application behavior. Continue at your own risk.
info - Using the experimental web runtime.
info - You have experimental React Server Components enabled.
info - Creating an optimized production build
Failed to compile.
./node_modules/next-i18next/dist/commonjs/serverSideTranslations.js
Module not found: Can't resolve 'fs' in '/Users/johannesandersen/Desktop/Johand/node_modules/next-i18next/dist/commonjs'
Import trace for requested module:
./node_modules/next-i18next/serverSideTranslations.js
./src/pages/404.tsx
./node_modules/next/dist/build/webpack/loaders/next-middleware-ssr-loader/index.js?page=%2F404&absolutePagePath=private-next-pages%2F404.tsx&isServerComponent=false&buildId=ciWvOQ9-dlRLa2Xan2Fte&basePath=&assetPrefix=!
./node_modules/next/dist/build/webpack/loaders/next-middleware-ssr-loader/index.js?page=%2F&absolutePagePath=private-next-pages%2Findex.tsx&isServerComponent=false&buildId=ciWvOQ9-dlRLa2Xan2Fte&basePath=&assetPrefix=!
Module not found: Can't resolve '/Users/johannesandersen/Desktop/Johand/pages/_document' in '/Users/johannesandersen/Desktop/Johand'
./node_modules/next/dist/build/webpack/loaders/next-middleware-ssr-loader/index.js?page=%2F&absolutePagePath=private-next-pages%2Findex.tsx&isServerComponent=false&buildId=ciWvOQ9-dlRLa2Xan2Fte&basePath=&assetPrefix=!
Module not found: Can't resolve '/Users/johannesandersen/Desktop/Johand/pages/_app' in '/Users/johannesandersen/Desktop/Johand'
./node_modules/next/dist/build/webpack/loaders/next-middleware-ssr-loader/index.js?page=%2F404&absolutePagePath=private-next-pages%2F404.tsx&isServerComponent=false&buildId=ciWvOQ9-dlRLa2Xan2Fte&basePath=&assetPrefix=!
Module not found: Can't resolve '/Users/johannesandersen/Desktop/Johand/pages/_document' in '/Users/johannesandersen/Desktop/Johand'
./node_modules/next/dist/build/webpack/loaders/next-middleware-ssr-loader/index.js?page=%2F404&absolutePagePath=private-next-pages%2F404.tsx&isServerComponent=false&buildId=ciWvOQ9-dlRLa2Xan2Fte&basePath=&assetPrefix=!
Module not found: Can't resolve '/Users/johannesandersen/Desktop/Johand/pages/_app' in '/Users/johannesandersen/Desktop/Johand'
> webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias
Nex dev output:
> next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
warn - You have enabled experimental feature(s).
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
warn - SWC minify beta enabled. https://nextjs.org/docs/messages/swc-minify-enabled
info - Using the createRoot API for React
warn - You are using an unsupported prerelease of 'react-dom' which may cause unexpected or broken application behavior. Continue at your own risk.
info - Using the experimental web runtime.
info - You have experimental React Server Components enabled.
wait - compiling...
event - compiled successfully in 5s (225 modules)
warn - using beta Middleware (not covered by semver) - https://nextjs.org/docs/messages/beta-middleware
wait - compiling /...
wait - compiling...
error - ./node_modules/next-i18next/dist/commonjs/serverSideTranslations.js
Module not found: Can't resolve 'fs' in '/Users/johannesandersen/Desktop/Johand/node_modules/next-i18next/dist/commonjs'
error - Error: ENOENT: no such file or directory, open '/Users/johannesandersen/Desktop/Johand/.next/server/middleware-ssr-runtime.js'
wait - compiling /_error...
wait - compiling...
error - ./node_modules/next-i18next/dist/commonjs/serverSideTranslations.js
Module not found: Can't resolve 'fs' in '/Users/johannesandersen/Desktop/Johand/node_modules/next-i18next/dist/commonjs'
Expected Behavior
When running npm run build
it should creating an optimized production build
To Reproduce
- Pull this branch down: https://github.com/Johannes-Andersen/Johand/tree/next12.0.1
npm install
3, and then try and build the app
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Blog - Next.js 12
We want to make every Next.js application build faster for production, ... To enable, use the experimental flag concurrentFeatures: true :
Read more >Next.js 12 Has Been Released - Morioh
We want to make every Next.js application build faster for production, and get instant ... To enable, use the experimental flag concurrentFeatures: true...
Read more >@next/react-dev-overlay: Versions | Openbase
Fix windows slashes for app client entry: #44052 ... Revert "Revert "Make concurrent features independent from the global runtime ... 12.0.1-canary.5.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems like
concurrentFeatures: true
is the issue and is broken in v12.0.1, turning it off fix it for me.I got this problem with a fresh project and this next.config.js: