Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
vue-router 4 redirects default url to page not found

I am migrating my vue application vue 2 to vue 3 by following vue migration official documentation. I have updated vue-router package. After updating router.js if i am running the application in my local by default it is routing to 404 page not found component.

Previously, It was routing to overview page(http://localhost:8080/overview). Now this url is routing to page not found. Here is my router.js

router.js

    /* [IMPORT] Library */
import { createRouter, createWebHistory } from 'vue-router';
/* [IMPORT] Common module */
import store                  from '~/common/store';
/* [IMPORT] modules */
import devModule              from '~/module/devModule';
import pageNotFoundPage       from '~/page/common/pageNotFound';

/* [IMPORT][PAGE] OverView */
import overviewPage           from '~/page/overview/overviewPage';

const routes = [

        { path: '/'   , redirect: '/dev'},
        { path: '/dev', component: devModule, children: [
            /* Default routing*/
            { path: '', redirect: 'overview/overview'},
            /* OVERVIEW */
            { path: 'overview', redirect: 'overview/overview'},
            { path: 'overview/overview' ,   component: overviewPage}
        ]},
        /* [404] anything else... */
        { path: '/:catchAll(.*)'   , component: pageNotFoundPage },
    ];

    export const router = createRouter({ history: createWebHistory(), routes });

/* [intercepter] */
router.beforeEach(function(to, from, next) {
    // 1. Update current URL :: for store
    store.commit('moveMenu',to.path);
    // x. go to next menu
    next();
});
export default router;

Why it is not routing to overview page after migration? Any suggestion or guide will be helpful related to this.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You should concatenate the child route path with parent one like :

http://localhost:8080/dev/overview

for more details check nested-routes section in official docs

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!