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

389
Views
Error de sintaxis de Vue JS: "Token inesperado, esperado,

Estoy trabajando en una aplicación Django que tiene VueJS. Soy nuevo en Django e incluso más nuevo en VueJS.

Recibo este error cuando intento ejecutar mi código:

ERROR No se pudo compilar con 1 error
14:11:51

error en ./src/router/index.js

Error de sintaxis: Token inesperado, esperado, (51:0)

49 | } 50 |

51 | }) | ^ 52 | 53 | exportar enrutador predeterminado 54 |

@ ./src/main.js 5:0-30 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

aquí está el contenido de mi archivo router/index.js:

 import Vue from 'vue' import Router from 'vue-router' import Chat from '@/components/Chat' import UserAuth from '@/components/UserAuth' Vue.use(Router) const router = new Router({ routes: [ { path: '/chats', name: 'Chat', component: Chat }, { path: '/auth', name: 'UserAuth', component: UserAuth } ] }) router.beforeEach((to, from, next) => { if (sessionStorage.getItem('authToken') !== null || to.path === '/auth') { next() } else { next('/auth') } } }) export default router

¿Cuál es el motivo del error de sintaxis y cómo lo corrijo?

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

0

Consulta el soporte extra que tienes en:

 router.beforeEach((to, from, next) => { if (sessionStorage.getItem('authToken') !== null || to.path === '/auth') { next() } else { next('/auth') } } <----------- })

Elimínelo, un consejo use editores de código, la mayoría de ellos indicarán estos errores tontos que quizás no se dé cuenta.

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!