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

323
Vistas
Adonis 5 + Vue "E_ROUTE_NOT_FOUND"

I'm doing an Adonis v5 app with Vue 2 as frontend. My problem is, once I've build Vue frontend into public adonis folder. If I access to a speficic route writing it into the top browser searcher, I get the E_ROUTE_NOT_FOUND from Adonis.

I do think that adonis is trying to search the route into the router of the server and not into the Vue router. Althought adonis it's configured to use static files and the first frontend page works:

Vue router.js:

Vue.use(VueRouter);
const routes = [
{
 path: "/",
 redirect: { name: "acceso" },
},
{
 path: "/acceso",
 name: "acceso",
 component: SignupView,
 meta: { guestAllow: true },
}];

const router = new VueRouter({
 mode: "history",
 routes,
});

Adonis routes.ts (It shouldn't affect as the have a prefix:

Route.group(() => {
  Route.group(() => {
    Route.post("register", "AuthController.register");
    Route.post("login", "AuthController.login");
  }).prefix("auth");
  Route.group(() => {
    Route.get("logs", "LogsController.index");
  }).middleware("auth:api");
}).prefix("/api");

Adonis static.ts:

import { AssetsConfig } from '@ioc:Adonis/Core/Static'
const staticConfig: AssetsConfig = {
 enabled: true,
 dotFiles: 'ignore',
 etag: true,
 lastModified: true,
 maxAge: 0,
 immutable: false,
}

If I write localhost:3333 on the browser I redirects to /access (Correct)

But if I refresh the page, or browse manually the same route, the error shows

Any idea of what could it be? Thank you for your time.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

After looking some other projects on internet, I've seen that if you use mode: "history" on vue-router it pops the error.

So I've tried to comment this line and now I can refresh the page without E_ROUTE_NOT_FOUND error.

Frontend Vue router.js:

const router = new Router({
  //mode: "history",
  routes,
});
about 4 years ago · Juan Pablo Isaza Denunciar
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