#fabianoarruda
1 messages ยท Page 1 of 1 (latest)
Hello ๐
just adding the script tag should work
unless your network request to get the script is failing somewhere
WHile loading it manually via script tag, do I still need to do
import { loadConnect } from "@stripe/connect-js";
?
I get this error if I do:
Uncaught TypeError: Failed to resolve module specifier "@stripe/connect-js". Relative references must start with either "/", "./", or "../".
that seems like react syntax so no you don't need that unless you're running a react app in your rails project
No I dont use React. just plain js.
you should be able to call loadConnect in your js directly once you include the script tag
Makes sense, That's exactly what I'm trying. I have inside page head:
<script src="https://connect-js.stripe.com/v0.1/connect.js"></script>
But still getting this error in my js console:
An error occurred: ReferenceError: loadConnect is not defined
Here is my js code (based in the example from Stripe Docs)
If you inspect the page, are you seeing the script loading successfully?
also if your code is trying to access loadConnect before script was loaded then it is possible that might be causing the error
can you add defer to your script tag?
Notice that I'm following the "beta" guide, bacause I'm tsting the payouts component
Seems to be loaded ok. Still, if I try loadConnect() in js console, I get that error
loadConnect is not defined
can you put a debugger before the line where you access loadConnect and see if the connect.js has been loaded by the time you're accessing it?
Tried adding defer, no luck also :/
Ok, I'll try that