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

154
Views
Localization routing not working in `vite-plugin-pages`

I have a project using Vite and vite-plugin-pages https://github.com/hannoeru/vite-plugin-pages. The plugin has generated routes and I tried to add my own route and the routes can be seen as below :

0: {path: '/', component: {…}, children: Array(1)}
1: {path: '/readme', component: {…}, children: Array(1)}
2: {path: '/modal', component: {…}, children: Array(1)}
3: {path: '/table', component: {…}, children: Array(1)}

// below is routes that I've added
4: {path: '/:locale/', component: {…}, children: Array(1)} // component & children copy from '/'
5: {path: '/:locale/readme', component: {…}, children: Array(1)} // component & children copy from '/readme'
6: {path: '/:locale/modal', component: {…}, children: Array(1)} // ...etc
7: {path: '/:locale/table', component: {…}, children: Array(1)}
length: 8
[[Prototype]]: Array(0)

When I tried to access it with http://localhost:4000/jp/ it always shown blank page. Why did I do wrong? I tried change the config :

Pages({
      extensions: ["vue", "md"],
      dirs: [
        { dir: 'src/pages', baseRoute: ':locale' }
      ]
    }),

Then it works, but it can't access to http://localhost:4000/. And then I tried to add new dir :

Pages({
      extensions: ["vue", "md"],
      dirs: [
        { dir: 'src/pages', baseRoute: ':locale' },
        { dir: 'src/pages', baseRoute: '' }
      ]
    }),

It doesn't work same as before. What should I do?

about 4 years ago · Juan Pablo Isaza
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!