missing param for named route "notfound": Expected "0" to be defined
See original GitHub issueI got this quite cryptic error message and I’m not sure what to make of it.
Relevant trace
assert @ vue-router.js?e71f:140
fillParams @ vue-router.js?e71f:1158
match @ vue-router.js?e71f:1007
transitionTo @ vue-router.js?e71f:1223
replace @ vue-router.js?e71f:1628
replace @ vue-router.js?e71f:1801
created @ edit.vue?dc4c:116
Offending code in edit.vue
this.$router.replace({
name: 'notfound',
})
Relevant routes
{
path: '*',
name: 'notfound',
component: require('./views/NotFound.vue'),
},
NotFound.vue
<script>
export default {
data() {
return {
}
},
}
</script>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:18 (4 by maintainers)
Top Results From Across the Web
Vue router - missing param for named route - Stack Overflow
This is a common mistake when you try to render 'detail.id' for the first time. Probably property 'id' is undefined. So you can...
Read more >[Solved]-Vue router - missing param for named route-Vue.js
This is a common mistake when you try to render 'detail.id' for the first time. Probably property 'id' is undefined. So you can...
Read more >Handling 404 errors with Vue Router - A. Muponda
Using the asterisk ( * ) in the Vue Router object definitions ... missing param for named route "notFound": Expected "0" to be...
Read more >Missing param for named route "X": Expected "Y" to be defined
The route that I'm trying to create is the /:name that will happen when I click on a name at a table inside...
Read more >Routing - Laravel - The PHP Framework For Web Artisans
All Laravel routes are defined in your route files, which are located in the routes directory. These files are automatically loaded by the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same error, I don’t know why; but I fixed it with the following code:
The fact is that when you do redirect to an asterisk, the router does not know which path should be in the location. You must pass this path yourself, eg:
push({ name: '404', params: { '0': 'somePath'} })
Here is a piece of my code from route guard for subdomains support, maybe useful