HELP: Vue-Router throwing Warning for Empty Initial Location #11231
Unanswered
lilz-sofia
asked this question in
Help/Questions
Replies: 1 comment
-
To define a empty component, try: {
path: '/',
name: 'empty-route',
component: defineComponent(() => () => h('div'))
} or a functional component: const Empty = () => h('div')
Empty.displayName = 'Empty'
const route = [
{
path: '/',
name: 'empty-route',
component: Empty
}
] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to migrate my app from vue2 to vue3, so I had to update my vue-router to 4.x too.
In my application the router is mostly through SSR. I'm using vue-router only for routing inside my modals (i.e in-app routing).
As I don't want my urls to be changed, I used to use
abstract mode
, which I had to change tocreateMemoryHistory
.This is my code for router:
In the

main.js
, I just wroteapp.use(router)
before mounting.I followed the migration guide as it is, but now I'm facing this warning:
As I read the documentation, I came to realize it is probably because of this following:
https://router.vuejs.org/guide/migration/#All-navigations-are-now-always-asynchronous
The initial location is getting nothing, as I don't push any route to the router until I open my modal. How can I handle this issue in a graceful way?
I tried to create a fallback path in my route like below:
But that throws another warning from vue about rendering deprecation:

Has anyone faced this problem before? I'm stuck with this problem for few day and would really appreciate some help 🙏
Beta Was this translation helpful? Give feedback.
All reactions