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

157
Vistas
How to get functions from a url <script> tag

In my Next JS app, I have an app.tsx page where external scripts are loaded as such

<Head>
   <script src="https://js.stripe.com/v3/"></script>
   ...other scripts and stuff
</Head>

The Stripe() function is loaded with the url, and I can access it's properties that work just fine, like:

Stripe("publishable key").redirectToCheckout({sessionId: 'sessionId'})

But when I attempt to build my app, I get this error:

ReferenceError: Stripe is not defined

And before you ask, the Stripe npm package is for backend code with the non-publishable key, so that won't work. But I need a way of importing the stripe script from the URL while defining the Stripe function so it isn't undefined.

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

0

Change Stripe to window.Stripe in your code may fix it

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