-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Open
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.
Description
Link to the code that reproduces this issue
https://github.com/rubenferreira97/turbopack_issue/tree/turbopack-namespace
To Reproduce
- Start
next dev - Go to localhost:3000
- See crash
Current vs. Expected behavior
Current Behavior:
Following error:
## Error Type
Runtime ReferenceError
## Error Message
a is not defined
at <unknown> (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\[root-of-the-server]__e206981a._.js:23:14)
at module evaluation (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\[root-of-the-server]__e206981a._.js:24:3)
at module evaluation (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\[root-of-the-server]__e206981a._.js:44:138)
at module evaluation (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\[root-of-the-server]__e206981a._.js:59:47)
at Array.__TURBOPACK__page__$23$5__ (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\1e749_next_dist_185248fe._.js:2670:62)
at async doRender (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\1e749_next_dist_185248fe._.js:3065:28)
at async handleResponse (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\1e749_next_dist_185248fe._.js:3271:32)
at async Module.handler (file://C:\Playground\turbopack_issue\client\.next\dev\server\chunks\ssr\1e749_next_dist_185248fe._.js:3642:20)
Next.js version: 16.1.6 (Turbopack)
Expected Behavior:
Should run/compile just fine.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Education
Available memory (MB): 16237
Available CPU cores: 12
Binaries:
Node: 25.2.1
npm: 11.6.2
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 16.1.6 // Latest available version is detected (16.1.6).
eslint-config-next: N/A
react: 19.2.3
react-dom: 19.2.3
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Minimal Reproduction:
/* - RUNTIME FAIL - */
export namespace Test {
export const a = 1;
}
export namespace Test {
export const b = a + 1;
}
/* - 1. WORKS - */
// export namespace Test {
// export const a = 1;
// }
// export namespace Test {
// export const b = Test.a + 1;
// }
/* - 2. WORKS - */
// export namespace Test {
// export const a = 1;
// export const b = a + 1;
// }Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SWCRelated to minification/transpilation in Next.js.Related to minification/transpilation in Next.js.TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.