Using next-intl Plugin with ES Modules in Next.js Configuration #324
-
Hello everyone, EDIT: This solution applies to I wanted to share my experience integrating the NOTE: I understand that this may be an obvious solution to an obvious problem for some, but then you wouldn't be here if it wasn't something you are trying to solve! Initially, I faced an error when trying to import the In the import nextIntl from "next-intl/plugin";
// Your existing Next.js configuration
const nextConfig = {
reactStrictMode: true,
experimental: {
appDir: true,
},
images: {
domains: ["tailwindui.com"],
},
};
// Use nextIntl to extend your configuration with the next-intl plugin
const withNextIntl = nextIntl("./i18n.ts");
export default withNextIntl(nextConfig); Please make sure that the path Keep in mind that while this approach worked for me, there might be other solutions or best practices. I hope this helps anyone facing a similar issue! Feedback and alternative solutions are welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
This really helped me, thank you! 🙏 |
Beta Was this translation helpful? Give feedback.
-
I don't get how you imported the |
Beta Was this translation helpful? Give feedback.
-
The installation instructions now cover |
Beta Was this translation helpful? Give feedback.
The installation instructions now cover
next.config.mjs
!