Static GitHub Issues

[1503] Error on directly accessing a dynamic route in the browser

prev: rc6 error
next: Pass props to nuxt component (or page)

Hi,

I use the latest version of nuxt (rc6) with the @nuxtjs/pwa module

I have a typical cateogry/_slug.vue page.

on that page, I have a simple created() method that gets the this.$route.params.slug variable and fetches the content from a static javascript array in the Store (No API call).

I can navigate to that page without any problem when clicking on a classic link in the app.

But when I try to access the page directly through the browser. example : http://localhost:3000/category/blog

I get a 500 Error, saying Cannot read property 'slug' of null, either on running npm run dev and npm run start

I tried replacing created() with beforeMount(), mounted(). And I still get the same error.

I have no clue on what is going on there. Is someone facing the same problem ?

Thanks a lot for your help, in advance !

<!--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/c1338">#c1338</a>)</em></sub></div>