Static GitHub Issues

[1553] extendRoutes not working

prev: Inject plugin in $root state & context
next: Error while initializing app DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method. at Object.We [as appendChild]

I have test.vue file under pages directory. So /test path automatically works. With the below configuration, I should have got /test1 pointing to that same test.vue file. However, when I load it on browser, I get 404.

    router:{
        extendRoutes(routes,resolve){
            routes.push({
                name:'test1',
                path:'/test1',
                component:resolve(__dirname,'pages/test.vue')
            });
        }
    }
<!--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/c1384">#c1384</a>)</em></sub></div>