Skip to content

next config file now has .mjs instead of .js? #60945

Answered by joulev
BearCooder asked this question in Help
Discussion options

You must be logged in to vote

require and module.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

import nextIntl from 'next-intl/plugin';

const withNextIntl = nextIntl('./i18n/i18n.ts');

export default withNextIntl({});

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@zacBkh
Comment options

@joulev
Comment options

@ISHA50
Comment options

@joulev
Comment options

@ayushghatkar8080
Comment options

Answer selected by BearCooder
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
8 participants