Try to build the minimal repo and get a build error
> next-error-template-issue@0.1.0 build /Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue
> next build
⚠ Invalid next.config.mjs options detected:
⚠ Expected object, received boolean at "experimental.serverActions"
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
⚠ Server Actions are available by default now, `experimental.serverActions` option can be safely removed.
▲ Next.js 14.0.4-canary.25
✓ Creating an optimized production build
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
Generating static pages (0/5) [ ]Error: Could not find the module "/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/client/components/error-boundary.js#" in the React Client Manifest. This is probably a bug in the React Server Components bundler.
at eS (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:129803)
at /Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142519
at Object.toJSON (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:143612)
at stringify (<anonymous>)
at eE (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131997)
at eR (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132440)
at Timeout._onTimeout (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:129220)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
Error: Could not find the module "/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/client/components/error-boundary.js#" in the React Client Manifest. This is probably a bug in the React Server Components bundler.
at eS (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:129803)
at /Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142519
at Object.toJSON (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:143612)
at stringify (<anonymous>)
at eE (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131997)
at eR (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132440)
at Timeout._onTimeout (/Users/mertdaglaroglu/Documents/WebProjects/Reactive/comnet/next-error-template-issue/node_modules/.pnpm/next@14.0.4-canary.25_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:129220)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
digest: '910671031'
}
Error occurred prerendering page "/_not-found". Read more: https://nextjs.org/docs/messages/prerender-error
Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.
✓ Generating static pages (5/5)
> Export encountered errors on following paths:
/_not-found
ELIFECYCLE Command failed with exit code 1.
Current vs. Expected behavior
Nextjs docs recommends placing global-error file inside app folder. However there is no instructions for internalization. Placing this file inside app/[lang] folder works just fine in dev environment yet it throws build error during static route generation. This looks like a build error rather than global-error file.
I've already created an issue about this along with not-found errors 2 months back and many reported same problem. However there is no solution to this problem yet (updated to the latest canary):
https://github.com/vercel/next.js/issues/56259
Due to missing global error file, website displays this on production build (browser's default JS error I guess):
Verify canary release
[X] I verified that the issue exists in the latest Next.js canary release
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/mertafor/next-error-template-issue
To Reproduce
Try to build the minimal repo and get a build error
Current vs. Expected behavior
Nextjs docs recommends placing global-error file inside app folder. However there is no instructions for internalization. Placing this file inside app/[lang] folder works just fine in dev environment yet it throws build error during static route generation. This looks like a build error rather than global-error file.
I've already created an issue about this along with not-found errors 2 months back and many reported same problem. However there is no solution to this problem yet (updated to the latest canary): https://github.com/vercel/next.js/issues/56259
Due to missing global error file, website displays this on production build (browser's default JS error I guess):
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
I tested this with latest canary 14.0.4-canary.25 and problem still exist.
It works before v13.4.20-canary.12