-
Hi. Why switch lang not working with custom routes? /en prefix in url showing page not found. Reproduction: |
Beta Was this translation helpful? Give feedback.
Answered by
simkuns
May 30, 2023
Replies: 1 comment 3 replies
-
One way to solve this is to rename |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue stems from the fact that
@nuxtjs/i18n
utilizes theextendPages
hook to retrieve the list of registered routes only during the build phase. However, app/router.options.ts is served as is once the server is already up and running, hence the mismatch.If you really want to have
app/router.options.ts
then you will have to add routes manually.Here's an example on how you can use the pages:extend hook within your configur…