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

289
Vistas
SDK Integration in Nuxt3 error with Axeptio

I am currently working on a Nuxt3 project and I need to integrate a script delivered by Axeptio (cookie platform).

I made Nuxt3 plugin to use their script integration


export default defineNuxtPlugin((useNuxtApp) => {
  ;(<any>window).axeptioSettings = {
    clientId: '...',
    cookiesVersion: '...',
  }

  ;(function (d, s) {
    var t:any = d.getElementsByTagName(s)[0],
      e: any = d.createElement(s)
    e.async = true
    e.src = '//static.axept.io/sdk.js'
    t.parentNode.insertBefore(e, t)
  })(document, 'script')
})

but this throws

Uncaught TypeError: Cannot read properties of undefined (reading 'REACT_APP_SC_ATTR')

So I tried in a Nuxt2 and it is working normally.

What can I do to make it work ?

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

0

Nuxt3 is based on Vite, hence not using process.env as Webpack4 (in Nuxt2).
Here is how to access env variables in Nuxt3, by using import.meta.env.YOUR_COOL_ENV_VAR.

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