In all routes with more than one level i have this warning:
[vue-router] Route with name 'usuario-editar-perfil-es-es' does not exist
Examples:
Route: http://localhost:3000/usuario/editar-perfil
[vue-router] Route with name 'usuario-editar-perfil-es-es' does not exist
Route: http://localhost:3000/usuario/mis-anuncios
[vue-router] Route with name 'usuario-mis-anuncios-es-es' does not exist
But in routes with only one level it is okay, for example:
http://localhost:3000/ayuda
http://localhost:3000/quienes-somos
My Nuxt version is 1.4.0 and nuxt-i18n version is 2.9.1.
Configurations:
defaultLocale: 'es',
locales: [
{
code: 'es',
iso: 'es-ES',
name: 'Espa帽ol',
langFile: 'es-ES.js'
},
{
code: 'en',
iso: 'en-US',
name: 'English',
langFile: 'en-US.js'
}
],
loadLanguagesAsync: true,
langDir: 'locales/'
Hi @javialon26, what does the files structure look like in your pages directory?
@paulgv this is the pages directory and now the same warning happens with all pages inside ayuda directory.

The warning appears when i enter the route.
Same problem here!
https://www.dropbox.com/s/d92gabryix5hk4b/Selection_009.png?dl=0
I fixed the problem by rewrite this code.
const routeName = route && route.name ? app.getRouteBaseName() : 'index';
@MoeCasts @paulgv
After the update the warning is still showing but i found the problem.
I have a custom breadcrumb component with a localePath method in a nuxt-link tag. The name param is taken from the store and the value is loaded in a middleware with the value of route.name, this value already has -es or -en suffix and when is passed to localePath the suffix is added again.
This will be fixed or i need to take care of this in my own code?
Thank you!
any news on this?
Hi @javialon26 !
Sorry I've not been able to spend much time on the module lately.
If your paths are already localized, you don't need to use localePath, you can simply pass them as is to <nuxt-link>, any way you could do that?
@paulgv you right, now i pass the route name directly to nuxt-link and everythings is ok. thank you!
I have the same issue, I opened another ticket for it though. Can't make i18n to work (Cannot continue my project without it) - Ignore the first part I was setting it up the 'old' way (I found that 6 hours later :P)
this.$router.push(this.localPath('/path'))
doesn't work.
I get the same warnging again.
@paulgv I'm still experiencing this issue with the '[vue-router] Route with name x does not exist' whenever I manually set enabled locales in the component. It seems the error is generated in every case where localePath is used: the only way to get rid of the warnings altogether is if I set SEO: false, remove all links with localePath and remove the language switcher so it seems like a warning is generated anywhere localePath is called. Do you have any idea how to fix this? Or @MoeCasts, could you repost the change you mentioned here https://github.com/nuxt-community/nuxt-i18n/issues/57#issuecomment-379045694 ?
i have the same problem, usually happens after rebuild.

i was able to narrow down the problem to this code:
this.extendRoutes((routes) => {
const localizedRoutes = makeRoutes(routes, {
...options,
pagesDir
})
routes.splice(0, routes.length)
routes.unshift(...localizedRoutes)
});
when rebuild starts routes already contains localized routes.
The same for me, as @pkorzh has, started after I鈥檝e updated nuxt to v2.*
Same here but only with hash key as @pkorzh and @cyxapb1280
:to="localePath({name:'index'},$i18n.locale)" > no warnings
:to="localePath({name:'index', hash:"#section-prices"},$i18n.locale)" > warnings crazy
Also with Nuxt 2.*, I'll try Nuxt 1
EDIT
Seems that even without localePath that :to="{name:'index', hash:"#section-prices"}" triggers weird errors also
So what is the solution for this issue when it's closed?
I get millions of these warnings because the generation of the alternate links.
i'm with this problem. Anybody has solution to fix this?
// Routes generation strategy, can be set to one of the following:
// - 'no_prefix': routes won't be prefixed
// - 'prefix_except_default': add locale prefix for every locale except default
// - 'prefix': add locale prefix for every locale
// - 'prefix_and_default': add locale prefix for every locale and default
strategy: 'no_prefix'
Problem still persists. strategy: 'no_prefix' is not ideal option as you loose all links.
But so far all I can do as localePath('index') is buggy.) I got all the time :
[vue-router] Route with name '/my_page___nl' does not exist vue-router.esm.js:16
You can fix this problem by installing @nuxtjs/router-extras and set a custom name for the route like this :

Most helpful comment
i have the same problem, usually happens after rebuild.
i was able to narrow down the problem to this code:
when rebuild starts
routesalready contains localized routes.