Static GitHub Issues

[1063] Route params not persistent in error layout

prev: How to use WOW.js with nuxt
next: Nuxt rebuild is taking too long (Feathersjs)

Hi,

I can't use <nuxt-link :to="{name: 'lang'}">Home page</nuxt-link> To redirect to my translated home page.

Error message from the console: [vue-router] missing param for named route "lang": Expected "lang" to be defined

pages directory structure:

pages/
--| _lang/
-----| index.vue
-----| about.vue

Error layout from the doc.

In the error layout, route.params is an empty object, but in others, it contains the lang entry. It's like the error is triggered before the params are injected. The router still have access to the named routes, this.$router.options.routes contains

[{
component: function _782fd8ab()
name: "lang"
path: "/:lang"
}, ...]

It's not that bad because I can get the current locale by using the store but it could be an improvement.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c929">#c929</a>)</em></sub></div>