next config file now has .mjs instead of .js? #60945
-
SummaryHi, I noticed that the recent next version after installing from scratch, has next.config.mjs instead of next.config.js? I noticed this due to the error
Changing from .mjs to .js solves this problem. But I am curious why the change? Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
import nextIntl from 'next-intl/plugin';
const withNextIntl = nextIntl('./i18n/i18n.ts');
export default withNextIntl({}); |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Just change /** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
}
export default nextConfig; |
Beta Was this translation helpful? Give feedback.
require
andmodule.exports
are invalid in ES modules (.mjs
files). If you do use.mjs
you need to use module import and export statements. For your config file that would be