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

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

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