You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just took a look at this and it appears that the compiled page is not using the renamed message variable and wanted to add some additional information.
So it looks like the build process is incorrectly processing the message var during compilation. Also checked against Next.js 15.4.0-canary.35 and the issue is still present.
Perhaps also worth noting that this error does not happen with the original code using the experimental turbo compiler.
Link to the code that reproduces this issue
https://github.com/dqfort/nextjs-build-error
To Reproduce
npm run build
, but it will fail.Current vs. Expected behavior
Current result:
Error occurred prerendering page "/test". Read more: https://nextjs.org/docs/messages/prerender-error
ReferenceError: message is not defined
Expected result
Creating an optimized production build ...
✓ Compiled successfully
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020 Available memory (MB): 65536 Available CPU cores: 12 Binaries: Node: 22.9.0 npm: 10.8.3 Yarn: N/A pnpm: N/A Relevant Packages: next: 15.3.2 // Latest available version is detected (15.3.2). eslint-config-next: 15.3.2 react: 19.1.0 react-dom: 19.1.0 typescript: 5.8.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
I tested it worked for this dependecies:
but not work for this dependecies:
The text was updated successfully, but these errors were encountered: