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

309
Views
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 answers
Answer question

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 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!