On this page
What this issue is
Stripe Elements (and the newer Payment Element) shows card fields inside an iframe served by Stripe. Your page loads https://js.stripe.com/v3/, creates a Stripe object with your publishable key, then mounts the element into an empty div on your page.
If any link in that chain breaks, the div stays empty or shows a spinner forever. The page looks mostly normal, so the problem is easy to miss.
- Checkout page loadsYour page and scripts arrive
- Stripe.js loadsjs.stripe.com/v3 is requested
- Element mountsCard iframe appears in the div
- Customer paysPayment is submitted
- Order and purchase trackingOrder created, tags fire
The break usually happens at the script, key or mount step. Everything after it is lost.
Why it costs you leads or sales
Without card fields, shoppers who are ready to buy cannot finish. Most will not report it. They leave, and you see only a drop in completed orders. Ad platforms also see fewer purchases, which can hurt campaign learning.
Example: illustrative numbers for a shop with steady traffic. Real figures depend on your store.
How to check if your site has it
Open the checkout in a private window
Add a product to the cart and go to the payment step. Use a clean browser with no extensions, then repeat on a phone.
Look for the card fields
You should see card number, expiry and CVC fields (or the Payment Element tabs). An empty gap or endless spinner means a failure.
Open the browser console
Press F12 and open Console. Look for errors mentioning Stripe,
Invalid API Key,Refused to load the scriptorContent Security Policy.Check the Network tab
Filter by
stripe. Confirmjs.stripe.com/v3/returns status 200 and that an iframe from js.stripe.com is in the page (Elements tab).Test with extensions and consent off
Ad blockers, privacy tools and some cookie banners can block Stripe. Try with them disabled to see if the form appears.
| What you see | Likely cause | Where to look |
|---|---|---|
| Refused to load the script js.stripe.com | Content Security Policy blocks Stripe | CSP header or meta tag |
| Invalid API Key provided | Wrong, missing or revoked publishable key | Plugin settings or code |
| Please provide a valid DOM element | Mount div missing or wrong selector | Checkout template |
| Stripe is not defined | Script did not load or loads after your code | Script order, optimisation plugins |
| Uncaught TypeError from another script | Another script crashed before Stripe mounted | The script named in the error |
How to fix it
Fix the cause you found in the console. The most common ones are below. If the fix depends on your platform, use the tabs.
Allow Stripe in your Content Security Policy
If you send a CSP header, allow
https://js.stripe.cominscript-srcandframe-src, andhttps://api.stripe.cominconnect-src.Use the correct publishable key
The key starts with
pk_live_on a live site. Never put the secret key (sk_) in front-end code. Make sure the key and the Stripe account match.Load Stripe.js from Stripe directly
Load
https://js.stripe.com/v3/from Stripe, not a copied or self-hosted file. Stripe does not support self-hosting.Exclude Stripe from script optimisation
Minify, combine, defer and delay-JS features can break Stripe. Exclude js.stripe.com and your checkout scripts, or exclude the checkout page.
Make sure the mount element exists
The div you pass to
mount()must exist in the DOM before you call it.Fix conflicting scripts
Disable recently added plugins or tags one by one and reload checkout to find the one that throws errors.
Check the Stripe plugin keys
In WooCommerce go to Settings > Payments > Stripe and reconnect the account or re-enter the publishable key for the right mode.
Exclude checkout from caching and JS optimisation
In your caching or optimisation plugin, exclude the cart and checkout pages and turn off delay or combine JS for js.stripe.com.
Test for a plugin or theme conflict
Switch to a default theme and disable other plugins on a staging copy, then re-enable one at a time.
Check the payment provider
In Settings > Payments confirm Shopify Payments (or your Stripe-based gateway) is active and has no warnings.
Review custom code and apps
Shopify hosts checkout, so a missing card form usually comes from an app, a custom checkout extension or a payment app setting. Disable recent ones to test.
Pause tags on the checkout
In Preview mode, or by pausing the container version, check whether a Custom HTML tag or trigger runs on checkout and throws errors.
Fix tags that block or move scripts
Remove any tag that rewrites the DOM, injects overlays or loads a different Stripe.js copy on payment pages.
Check custom code on the page
In Page settings > Custom code, make sure the Stripe script tag and your mount code are present and in order.
Confirm the embed div exists
If you use an Embed element for the card div, check its id matches your mount code and that the page is published.
Check the Stripe connection
In Payments > Integrations confirm Stripe is connected in the right mode (live or test).
Review custom code on the funnel page
Remove custom JavaScript or CSS in the funnel step that could hide or break the payment element, then preview.
Check the payment provider
In Settings > Accept Payments confirm Stripe is connected and enabled.
Remove custom embeds on checkout
Disable custom code in Settings > Custom code that targets checkout pages and test again.
Reconnect Stripe
In Commerce > Payments disconnect and reconnect Stripe if the card form is missing.
Remove code injection
In Settings > Advanced > Code Injection remove scripts that could break checkout, then retest.
Load Stripe.js and mount after the DOM is ready
Use the snippet below. Replace the key with your own publishable key.
Handle load errors
Check that Stripe() returned an object and that the mount div exists, and log any error so you can see it.
<div id="payment-element"></div>
<script src="https://js.stripe.com/v3/"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
if (typeof Stripe === 'undefined') {
console.error('Stripe.js did not load');
return;
}
var stripe = Stripe('pk_live_YOUR_PUBLISHABLE_KEY');
// clientSecret comes from your server (PaymentIntent)
var elements = stripe.elements({ clientSecret: window.CLIENT_SECRET });
var paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
});
</script>script-src https://js.stripe.com;
frame-src https://js.stripe.com https://hooks.stripe.com;
connect-src https://api.stripe.com;Broken
- Empty box or endless spinner
- Console shows a blocked script or invalid key
- Shoppers leave without paying
Fixed
- Card fields render inside the Stripe iframe
- No Stripe errors in the console
- Test payment completes and an order is created
How to confirm it's fixed
- Card fields appear on desktop and mobile in a clean browser
- js.stripe.com/v3/ returns 200 in the Network tab
- No Stripe or CSP errors in the console
- A test payment in Stripe test mode (card 4242 4242 4242 4242) succeeds
- The order appears in your store and in the Stripe dashboard
- Purchase tracking fires after the test order
How to prevent it happening again
- Test checkout after every plugin, theme, tag or security header change
- Keep a staging site and test CSP changes there first
- Exclude checkout pages from caching and script delay rules
- Store the publishable key in one place and check it when you rotate keys
- Review Stripe dashboard notices about API versions or account restrictions
- Monitor the checkout on a schedule so a break is caught within hours
How FunnelGuard handles this
FunnelGuard detects this today. Its robot visitor runs your checkout journey on a schedule and includes a payment methods check. That check looks for the payment options and card form on the payment step, so a missing Stripe card iframe shows up as a failed step.
If a check fails, FunnelGuard re-checks from a second region before sending one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty. The alert includes a screenshot and a likely cause. Test traffic is marked, never enters real card details and stops before payment unless your store's test mode is set up.
You can start with the Free plan (1 site, 2 journeys, daily checks, no card), or try a paid plan free for 3 days. A free read-only website audit is also available.
Questions people ask
Why is my Stripe card form not showing at checkout?
Usually Stripe.js did not load or the Element could not mount. Common causes are a Content Security Policy blocking js.stripe.com, a wrong publishable key, a missing mount element, or a JavaScript error from another script. The browser console normally names the cause.
How do I fix a blank Stripe Elements iframe?
Open the console and Network tab on the checkout page. Fix what they show: allow js.stripe.com in your CSP, use the correct pk_ key, make sure the mount div exists, and exclude Stripe from minify or delay-JS settings. Then run a test payment.
Can an ad blocker or cookie banner hide the Stripe card form?
Yes. Some privacy extensions and consent tools can block scripts or iframes, including Stripe. Test in a clean browser with extensions off. If it works there, review how your consent or blocking rules treat Stripe, which is needed for payments.
Why does the Stripe card form work in test mode but not live?
The live site is often using a test publishable key, a mismatched account, or a live key that was not saved. Check the key starts with pk_live_ and belongs to the same Stripe account as your secret key and webhooks.
Does Content Security Policy block Stripe Elements?
It can. If your CSP does not allow https://js.stripe.com in script-src and frame-src, and https://api.stripe.com in connect-src, the browser refuses to load Stripe and the card fields stay empty.
Why does the Stripe card form not load after I installed a caching or speed plugin?
Minify, combine, defer and delay-JS features can change script order or stop Stripe.js running in time. Exclude js.stripe.com and your checkout pages from these features, then clear the cache and retest.
How can I know if my checkout card form breaks?
Check the checkout regularly yourself, or use monitoring. FunnelGuard runs your checkout journey on a schedule, checks the payment methods step and alerts you with a screenshot and likely cause if the card form is missing.
Related issues
- CNV-202PayPal button missingFix guide
- CNV-203Apple Pay/Google Pay button missing on supported devicesFix guide
- CNV-205Payment gateway in test mode on live siteFix guide
- CNV-206Payment gateway keys expired, all payments declinedFix guide
- CNV-209Payment succeeds but order not createdFix guide
- CNV-215Payment page shows mixed content warningFix guide