#martin-gaibisso_error
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1339290974253355059
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- martin-gaibisso_docs, 1 day ago, 22 messages
Hi ๐
Can you provide more details about what is happening in prototype.js on and before line 828?
What are you trying to do on the line where the error is thrown?
i'm not trying to do anything, this is your library failing to initialize
Supply and repair of all makes of Electric Motors, motor slide rails Gears, skf motor bearings, Pumps and Fans. Over 25 years experience with both in-house and onsite services.
here you can see the error message in the console with the full stack
Can you share what you are doing in prototype.js on line 838?
How/where are you instantiating Stripe.js?
just loading the file and this happens
i get Uncaught ReferenceError: Stripe is not defined if i try to use it
The request to https://js.stripe.com/v3/ is returned with a 200 status and the Stripe.js code.
How are you loading it on your site?
<script src="https://js.stripe.com/v3/" type="text/javascript"></script>
And you get an error when you attempt to run
var stripe = Stripe('pk_XXXXX');
correct
no
the original error is when loading the lib
if i try to initialize i get Uncaught ReferenceError: Stripe is not defined
The resource is being returned correctly. You can see that in the Networks tab.
Are you using some web framework that might be attempting to use Stripe.js before the DOM has loaded?
What do you mean?
I am saying I suspect that you are attempting to load/use Stripe.js before Stripe.js has been loaded by your site
If you are using a framework that performs some operations server-side, before the client loads, that might cause an error like this
i dont understand why anything server side would affect a js library being loaded in the browser
but why no Stripe available?
I am saying, I think your site is attempting to use it before it's loaded in the browser
Basically, I know loading Stripe.jS from the <script src="https://js.stripe.com/v3/"></script> tag works just fine. I've loaded over 20 sites that use it while we've had this chat.
What I am attempting to determine, based mostly on guesses, is what might result in you attempting to use it without having it correctly loaded in your JS runtime environment.
So far, you have not provided much information about how your site is built and what frameworks you are using
That would be helpful
i know it works, i also have deployed a lot of sites. we make a plugin for magento that integrates stripe connect. there is a problem with this particular one
what i dont understand is why would the init of the Stripe lib fails
since that i presume is a standalone lib
the file loads
but the init fails with that error
even if i try using the lib when still not ready, it should work afterwards
the lib loads but yet: Uncaught ReferenceError: Stripe is not defined
Where are you attempting to perform the initialization?
if you go to https://www.electricmotormarket.co.uk/ open a console and type "Stripe" you can test by yourself
Supply and repair of all makes of Electric Motors, motor slide rails Gears, skf motor bearings, Pumps and Fans. Over 25 years experience with both in-house and onsite services.
Hmm...definitely not loaded. Neither Stripe nor window.Stripe
And, if you look at the v3/ network response payload, you can see its an IIFE that returns the Stripe lib
yeah, idk why it doesn't initialize
only happening on this site but i have no idea why
Yeah that's why I'm wondering what about this site might be causing the issues. Something in the architecture.