@nrwl/next does not pickup new v10 Internationalized Routing (i18n object in next.config.js)
Vercel added Internationalized Routing (i18n object in next.config.js) in Next v10.
When I add an i18n configuration object in next.config.js I excpect that the Next app in Nx is picking it up and activates v10 Internationalized Routing.
nx g @nrwl/next:app web
module.exports = {
i18n: {
locales: ['en', 'fr', 'nl'],
defaultLocale: 'en',
},
};
nx serve web
NX Report complete - copy this into the issue template
nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.3.0
@nrwl/cypress : 10.3.0
@nrwl/eslint-plugin-nx : 10.3.0
@nrwl/express : Not Found
@nrwl/jest : 10.3.0
@nrwl/linter : 10.3.0
@nrwl/nest : Not Found
@nrwl/next : 10.3.2
@nrwl/node : Not Found
@nrwl/react : 10.3.0
@nrwl/schematics : Not Found
@nrwl/tao : 10.3.0
@nrwl/web : 10.3.0
@nrwl/workspace : 10.3.0
typescript : 4.0.3
@pmualaba For what I can see @nrwl/next use "next": "^9.3.3". Since i18n is a v10 feature I think is expected to not work. I would not tag as a bug.
If you add next v10 in your project i18n will work works (for what I've seen with a quick test).
I also have a problem with Internationalized Routing.
If I run a build though NX as: ./node_modules/.bin/nx serve app --prod
"/" route without a locale prefix (next uses default locale in this case) works correctly
If I go to dist folder, install dependencies and run through NPM as: npm start
"/" route without a locale prefix returns 404
Seems like next.config.js is not copied on build to dist folder
Seems like
next.config.jsis not copied on build to dist folder
If I copy next.config.js to dist folder, routing works correctly.
I have created a PR #4179 that should resolve this issue