nuxtjs spa dynamic routes generate 404 after prod deployment
My solution for this problem was to convert dynamic routes to static routes and move the params
argument to query
instead.
In my case /product/_id.vue
changed to /product.vue
and references to params: {id: product_id}
changed to query: {id: product_id}
.
All n-link
paths needed to be updated from :to="'/product/' + product_id"
to :to="'/product?id=' + product_id"
and I had to add beforeRouteUpdate to the product.vue page component to handle nuxt links that changed the query, but not the page.