2

So recently I implemented lazy loading to all my routers. Everything seems to work well, except I just noticed recently that I am unable to navigate to a child's router path. I tried removing the lazy loading and everything works as it supposed to. Any ideas on how I can fix this?

User's flow: The user clicked the sign up button and it will navigate the user to the verify phone page. After the user is redirected to the verify phone page, the user clicked verify email to gets redirected to verify email page. However instead of being redirected to verify email page it just redirects back to verify phone page.

This is the router code:

{
    path: "/sign-up",
    name: "SignUp",
    component: () => import("@/views/Dashboard/SignUp.vue"),
    children: [
      {
        path: "/sign-up-verify-phone",
        name: "VerifyPhone",
        component: () => import("@/views/Dashboard/VerifyPhone.vue"),
      },
      {
        path: "/sign-up-verify-email",
        name: "VerifyEmail",
        component: () => import("@/views/Dashboard/VerifyEmail.vue"),
      },
      
    ],
  },
1
  • Can you link to a reproduction? Commented Mar 9, 2021 at 21:50

1 Answer 1

1

some time ago, they changed the vue-template-compiler, so you have to return .default of the es6-module: https://github.com/vuejs/vue-router/issues/1379#issuecomment-298298329

component: () => import("@/views/Dashboard/VerifyEmail.vue").then(c => c.default)
Sign up to request clarification or add additional context in comments.

2 Comments

this doesn't work out, I still have the same error.
which transpiler do you use?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.