Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda