3

I'm making a multilingual service using next-i18next, but there seems to be an error related to routing

Git Repository: https://github.com/fatherslable/test-repo

problem situation

  1. If you connect to localhost:3000 and press refresh, there is no problem.
  2. There is no problem even if you connect to localhost:3000/test and press refresh.
  3. If you connect to localhost:3000/en and press refresh, there is no problem.
  4. If you connect to localhost:3000/en/test and press refresh, a 404 error occurs.

It seems that my next app cannot find the page if I refresh it while the language of another country such as en is applied instead of ko.

What am I missing?

dongik kim
  • 31
  • 1

2 Answers2

0

The repo is down, and I suppose that I am late to the party, but in case anyone else encounters something similar double check your next.config.js. It can be that some config is missing (for example sub-path-routing might be missing locales, the language from locales or defaultLocale).

Also make sure you are not using any routing from React ( more details here about this topic)

Berci
  • 2,876
  • 1
  • 18
  • 28
0

I also faced the same issue. When I restart the backend server whenever I deploy a newly built code on the server, the problem goes away.

Asaye
  • 131
  • 1
  • 3