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

254
Views
error de vue-gtag: "se excedió el tamaño máximo de la pila de llamadas"

Tengo una aplicación Vue escrita en Typescript, para la cual el seguimiento a través de Google Analytics necesita dimensiones personalizadas. El paquete "vue-gtag" parecía ser la mejor opción, así que lo instalé. Leí la documentación e intenté configurarlo de la misma manera.

En mi principal, está incluido en Vue así:

 Vue.use(VueGtag, { config: { id: 'GTM-XXXXXXX' }, router, });

Mi enrutador está configurado así:

 Vue.use(VueRouter); const routes: Array<RouteConfig> = [ { path: '', component: LoggedInLayout, meta: { requiresAuth: true, }, children: [ // Children that require auth { path: '', redirect: '/dashboard', }, { path: '/dashboard', name: 'Dashboard', component: Dashboard, }, { path: '/settings', name: 'User Settings', component: UserSettings, meta: { title: 'Custom page title' }, }, { path: '/search/:page', name: 'Search', component: Search, props: (route) => ({ ...route.params, }), meta: { title: 'Custom page title' }, }, // More like this ], }, { path: '', component: DefaultLayout, meta: { requiresAuth: false, }, children: [ // Children that don't require auth { path: '', redirect: '/home', }, { path: '/home', name: 'Home', component: Home, meta: { title: 'Custom page title' }, }, { path: '/about', name: 'About', component: About, meta: { title: 'Custom page title' }, }, { path: '/contact', name: 'Contact', component: Contact, meta: { title: 'Projektagenten - Kontakt Os' }, }, // More like this // Any other path we redirect to home { path: '*', redirect: '', }, ], }, ]; const router = new VueRouter({ mode: 'history', routes, scrollBehavior: (to) => { if (to.hash) { return { selector: to.hash, }; } else { return { x: 0, y: 0 }; } }, }); // Authentication guard for routes with authentication required router.beforeEach((to, from, next) => { if (to.matched.some((record) => record.meta.requiresAuth == true)) { if (!cookieUtils.getCookie('session')) { next({ name: 'Home' }); } else { next(); } } else { next(); } }); router.afterEach((to, from) => { Vue.nextTick(() => { document.title = to.meta.title || to.name; }); }); export default router;

Mi problema comienza cuando ejecuto el proyecto y abro la página del proyecto, aparece una página en blanco y el siguiente error en la consola:

Mensaje de la consola

Parece que he activado una llamada recursiva interminable dentro de vue-gtag, ya que el código fuente se ve así: Código fuente del error

Estoy teniendo dificultades para identificar este error y lo que hice mal. Se agradece cualquier ayuda, también diferentes soluciones a la tarea que inicialmente estoy tratando de realizar.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Debe pasar el enrutador como el tercer parámetro para Vue.use () y no como parte del segundo argumento

 Vue.use(VueGtag, { config: { id: 'GTM-XXXXXXX' }, }, router);

Consulte la documentación aquí: https://matteo-gabriele.gitbook.io/vue-gtag/auto-tracking

over 4 years ago · Santiago Trujillo 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!