Static GitHub Issues

[906] Accessing the meta fields in extendedRoutes defined in nuxt config

prev: Can't override default webpack loader config
next: Lazy Loading Routes

I've been trying to get access to the meta field in this.$route in the 404.vue page component. I copied the extendedRoutes example from here and appended meta like below:

module.exports = {
  router: {
    extendRoutes (routes, resolve) {
      routes.push({
        name: 'custom',
        path: '*',
        component: resolve(__dirname, 'pages/404.vue'),
        meta: { name: 'Pumpkin', age: 19 }
      })
    }
  }
}

I'm getting undefined when we access the above name variable using meta property. Although, the vue-router documentation says we can access it correctly here

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