Can you help me figure out why this page is loading so fast?
https://nextjs-typescript-react-stripe-js.vercel.app/donate-with-elements
I implemented Stripe Elements into my webpage yesterday. To load it you need to first create a payment intent and receive a secret client key to load the Stripe component. When you go on this site, the component just loads instantly as if the page is static or something...? You can see the GitHub repo below. I'm only concerned about the /donate-with-elements part. I've been trying to scour the code and see what they did differently, but I can't figure out how their page loads so fast.
TypeScript Next.js Stripe Example
Full-stack TypeScript example using Next.js, react-stripe-js, and stripe-node.
18 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
There is. For the PaymentElement component to render it needs a payment_intent which is fetched here:
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
GitHub
next.js/api-helpers.ts at 2085dac9267800ca6c8895120d85331bf3f6353e ...
The React Framework. Contribute to vercel/next.js development by creating an account on GitHub.
And this API helper is awaiting
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
It is though
GitHub
next.js/donate-with-elements.tsx at 2085dac9267800ca6c8895120d85331...
The React Framework. Contribute to vercel/next.js development by creating an account on GitHub.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Yeah, so what the fuck?
I tried it locally and ther it loads
But on their website it doesn't load at all?
How can you check this btw?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I'd love to know how
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
It definitely does not run per request
That's impossible
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
So it's non-functional practically then, right?
Yeah
It loads when I run it locally
Even the stripe checkout itself is not that fast
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Ok I'll try when I get on my computer
Thanks for your insight
I really appreciate it
But the conclusion here is that this speed is non-functional