Skip to content

fix(nextjs): support next.config.mts - #684

Merged
leoortizz merged 2 commits into
mainfrom
fix/nextjs-next-config-mts
Aug 31, 2026
Merged

leoortizz merged 2 commits into
mainfrom
fix/nextjs-next-config-mts

Conversation

@leoortizz

Copy link
Copy Markdown
Member

Next.js supports next.config.mts, but the adapter threw an
unsupported-extension error for it.

.mts is always an ES module, so it is handled like .mjs:
the renamed original is imported with its extension and
the config is emitted as export default.

Fixes #680

Next.js supports next.config.mts, but the adapter threw an
unsupported-extension error for it.

.mts is always an ES module, so it is handled like .mjs:
the renamed original is imported with its extension and
the config is emitted as `export default`.

Fixes #680

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the ".mts" (TypeScript ESM) file extension for Next.js configuration files. It updates the build process, config override logic, and restoration steps to recognize and correctly handle ".mts" files alongside existing formats like ".js", ".mjs", and ".ts". Additionally, a new unit test has been added to verify the override behavior for ".mts" configurations. I have no feedback to provide.

@leoortizz
leoortizz merged commit ac79bb9 into main Aug 31, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adapter-nextjs: next.config.mts is rejected, and the failure leaves the config renamed away

2 participants