@nrwl/next does not pickup new v10 Internationalized Routing (i18n object in next.config.js)
See original GitHub issueCurrent Behavior
@nrwl/next does not pickup new v10 Internationalized Routing (i18n object in next.config.js)
Expected Behavior
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.
Steps to Reproduce
- In an empty Nx workspace create a Next app :
nx g @nrwl/next:app web
- in /apps/web/next.config.js add the i18n configuration object as per the official docs
module.exports = {
i18n: {
locales: ['en', 'fr', 'nl'],
defaultLocale: 'en',
},
};
- launch the Next app and try to navigate to /nl or /fr : This should display the Index Page, but it renders 404 instead.
nx serve web
Failure Logs
Environment
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
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
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 correctlyIf I go to dist folder, install dependencies and run through NPM as:
npm start
“/” route without a locale prefix returns 404Seems like
next.config.js
is not copied on build to dist folder