Open stefanprobst opened 1 month ago
https://github.com/stefanprobst/issue-next.config.ts-await
pnpm install && pnpm run dev
ReferenceError: await is not defined
top-level await works in next.config.js but not in next.config.ts.
next.config.js
next.config.ts
Operating System: Platform: linux Arch: x64 Version: #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 Available memory (MB): 15893 Available CPU cores: 4 Binaries: Node: 20.14.0 npm: 10.7.0 Yarn: N/A pnpm: 9.5.0 Relevant Packages: next: 15.0.0-canary.67 // Latest available version is detected (15.0.0-canary.67). eslint-config-next: N/A react: 19.0.0-rc.0 react-dom: 19.0.0-rc.0 typescript: 5.5.3 Next.js Config: output: N/A
TypeScript
next dev (local)
No response
Thank you for reporting this! We will surely get this fixed before going stable. Thank you once again!
Link to the code that reproduces this issue
https://github.com/stefanprobst/issue-next.config.ts-await
To Reproduce
pnpm install && pnpm run dev
Current vs. Expected behavior
top-level await works in
next.config.js
but not innext.config.ts
.Provide environment information
Which area(s) are affected? (Select all that apply)
TypeScript
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response