- 
                Notifications
    
You must be signed in to change notification settings  - Fork 29.8k
 
Description
What is the documentation issue?
Description
There’s a contradiction in the Next.js documentation regarding the use of .mts for configuration files.
📄 References
- 
ECMAScript Modules section
https://nextjs.org/docs/app/api-reference/config/next-config-js#ecmascript-modules“Good to know:
next.configwith the.cjs,.cts, or.mtsextensions are currently not supported.” - 
TypeScript configuration section
https://nextjs.org/docs/app/api-reference/config/typescript#for-commonjs-projects-default“Therefore, we recommend using the
next.config.mtsfile for CommonJS projects to explicitly indicate it’s an ESM module.” 
⚠️  Problem
- The first page says 
.mtsis not supported fornext.config. - The second page recommends using 
.mtsfor TypeScript projects. - This leaves readers unsure whether 
.mtsis officially supported or not. 
This inconsistency is confusing, especially for developers working with TypeScript and ESM/CommonJS interop.
🙏 Thank you
Thank you for maintaining great documentation — just hoping to clarify this inconsistency to help others avoid confusion!
Is there any context that might help us understand?
✅ Suggested Fix
- Clarify whether 
.mtsis actually supported fornext.config. - If it is supported:
- Update the “not supported” warning to explain the specific context where it’s allowed (e.g., TypeScript + ESM).
 
 - If it is not supported:
- Remove or reword the 
.mtsrecommendation from the TypeScript docs. 
 - Remove or reword the 
 - Consider adding a table summarizing which extensions are supported per environment:
File Type CommonJS ESM Notes next.config.js✅ ✅ Default next.config.mjs❌ ✅ For ESM projects next.config.cjs✅ ❌ For CommonJS projects next.config.ts✅ ✅ TypeScript version next.config.mts❓ ❓ Clarify status  
💻 Environment (for context)
- Next.js version: Latest (as of November 2025)
 - Node.js: v24
 - TypeScript project using 
"type": "module" - Tried both 
next.config.tsandnext.config.mts 
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/api-reference/config/next-config-js#ecmascript-modules