#Vaibhao
1 messages · Page 1 of 1 (latest)
👋 I'm not an experienced React developer myself so that will not make it easy. You shared pictures. What's your real code, what's the problem?
try to load these scripts in index.html
what does that mean?
I want to use stripe elements once this script loads successfully, but it throws error. I just added this as script reference like we do in standard HTML. code is available here - https://github.com/VChawale/my-app/blob/main/public/index.html
Are you an experienced React developer? Have you used the UMD approach before?
I am experienced React dev, but used UMD approach few times before, this is the standard way of calling script from index.html page.
Okay, so what errors are you getting exactly?
react-stripe.umd.js:338
Uncaught TypeError: Cannot read properties of undefined (reading 'createContext')
at react-stripe.umd.js:338:44
at react-stripe.umd.js:4:29
at react-stripe.umd.js:5:2
I posted screenshot of error as well
so what triggers this? just the inclusion of the script? Or you trying to do something with it?
page load triggers this, since it is included in body tag of HTML. Once this script loads fine, I can do rest of my development
since react is already part of my app, I don't need to, but I will try adding that.
yeah locally if we add <!-- React --> <script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script> <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script> it works
yeah it is working, thank you for the help @neat dew , much appreciated.