question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@nrwl/next does not pickup new v10 Internationalized Routing (i18n object in next.config.js)

See original GitHub issue

Current 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

  1. In an empty Nx workspace create a Next app :
nx g @nrwl/next:app web

  1. 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',
  },
};

  1. 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:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
MaxBoltikcommented, Nov 17, 2020

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

2reactions
neilhemcommented, Nov 18, 2020

Seems like next.config.js is not copied on build to dist folder

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Features: Internationalized Routing - Next.js
Next.js has built-in support for internationalized (i18n) routing since v10.0.0 . You can provide a list of locales, the default locale, and domain-specific ......
Read more >
Internationalized Routing in Nextjs - Stack Overflow
js router in next-i18next by using the following code: const { i18n } = useTranslation(); // These are mock locales, you can get...
Read more >
How to implement i18n in Next.js - Daily.dev
According to Wikipedia, Internationalization is the process of designing a software application so that it can be adapted to various languages ...
Read more >
Localizing Your Next.js App - Smashing Magazine
Your Next.js is now fully prepared for internationalization. It will: Pick up the user's preferred locale from the Accepted-Languages header in ...
Read more >
Internalization with NextJS | Amourycodes
Although the documentation mentions that i18n routing is meant to complement ... Next.js provides a way to implement internationalization, but is totally ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found