Skip to content

Commit d6b932d

Browse files
devjiwonchoiijjk
andauthored
docs: module resolution for next.config.ts is currently limited to CommonJS (#71162)
### Why? In current state, `next.config.ts` cannot resolve Native ESM syntax. Therefore it may import extensions `.js`, `.mjs`, `.cjs`, it will throw when the imported module uses Native ESM syntax like top-level await. Closes NDX-368 --------- Co-authored-by: JJ Kasper <[email protected]>
1 parent 719de07 commit d6b932d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/02-app/01-building-your-application/07-configuring/01-typescript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const nextConfig: NextConfig = {
103103
export default nextConfig
104104
```
105105

106-
> **Good to know**: You can import Native ESM modules in `next.config.ts` without any additional configuration. Supports importing extensions like `.cjs`, `.cts`, `.mjs`, and `.mts`.
106+
> **Note**: Module resolution in `next.config.ts` is currently limited to `CommonJS`. This may cause incompatibilities with ESM only packages being loaded in `next.config.ts`.
107107
108108
<AppOnly>
109109

0 commit comments

Comments
 (0)