Router is not generating proper routes
See original GitHub issueVersion
nuxt: 2.12.2, nuxt-i18n: 6.11.1
Nuxt configuration
mode:
- universal
Reproduction link
https://codesandbox.io/s/nuxt-nuxt-i18n-base-template-8iqxp
Code
/pages
structure:
_id.vue
:
<template lang="pug">
div
p Page
</template>
Configuration:
i18n: {
defaultLocale: 'pl',
lazy: true,
langDir: 'lang/',
locales: [
{
code: 'en',
name: 'English',
file: 'en-US.js',
flag: '🇬🇧'
},
{
code: 'pl',
name: 'Polski',
file: 'pl-PL.js',
flag: '🇵🇱'
},
],
}
autogenerated .nuxt/router.js
:
What is Expected?
To have dynamic route working.
What is actually happening?
/en/therapists/:id
is working even though in router it’s not prefixed now it’s not working too. When I switch to default locale (pl) then page is not found unless I type therapists
instead of terapeuci
.
/therapists
(index.vue) works perfectly in both langs.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
nuxt-modules/i18n - Router is not generating proper routes
To have dynamic route working. What is actually happening? /en/therapists/:id is working even though in router it's not prefixed now it's not ......
Read more >Solved: Router not routing - Cisco Community
1.254 and create a routing for 10.24.1.0/24 via 192.168.1.253. Also I believe that some of the routers must NAT 10.24.1.0/24 behind itself.
Read more >Why is my router not routing? - Super User
It seems obvious, but check that things are cabled up right. Is the cable modem connected to the WAN port of the router?...
Read more >Express router is not routing to the correct path even though ...
The page that it should be routed to is localhost:5000/users/login but it is instead routing localhost:5000/login. I was referencing the Vidjot ...
Read more >Router tutorial: tour of heroes - Angular
Later, this guide shows you how to create multiple routing modules and import those routing modules in the correct order. The application continues...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The simplest mistakes are the easiest to make. Thanks a lot! That solved my problem - can’t believe I didn’t thought of it by myself. Pozdrawiam 😃
You do need to also set custom paths for the dynamic route. Can’t expect those to follow the
therapists/index.vue
magically as those are two separate routes.So add this for
_id.vue
route: