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

175
Views
Nuxt.js no puede configurar la cookie, "indefinido (leyendo 'establecer')" (cookie-universal-nuxt)

Cuando intento configurar una cookie con cookie-universal-nuxt en el middleware de mi enrutador, aparece el error:

 TypeError: Cannot read properties of undefined (reading 'set')

¿Qué está causando esto?

nuxt.config.js

 modules: [ 'cookie-universal-nuxt', ],

router.js (middleware de enrutador)

 export default async ({ app }) => { app.$cookies.set('cookie-name', 'cookie-value', { path: '/', maxAge: 60 * 60 * 24 * 7 }); }

Intenté iniciar sesión en diferentes lugares:

Cuando ejecuto console.log(app.$cookies) en el enrutador, devuelve indefinido.

Cuando lo ejecuto en un componente (entonces: console.log(this.app.$cookies) ) devuelve Cannot read properties of undefined (reading 'app') . Estoy usando la API de composición, así que también probé console.log(context.root.$cookies) pero esto también devuelve indefinido.

about 4 years ago · Juan Pablo Isaza
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!