On this page
What this issue is
Stripe Elements and the PayPal button are not part of your page. Your page loads a script from Stripe (js.stripe.com) or PayPal (paypal.com/sdk/js), and that script draws the card fields or the button inside an empty container on your page, usually in an iframe.
The widget is not rendering when that chain breaks. The page still loads and looks normal, but where the payment form should be there is a blank space, a spinner that never stops, or nothing at all.
- Product pageLoads normally
- Cart and checkoutLoads normally
- Payment widgetScript blocked or container missing
- Order placedCannot happen
- Purchase trackingNever fires
The page loads fine, but the widget never draws, so the funnel ends at payment.
Why it costs you leads or sales
This sits at the last step before money changes hands. Shoppers who got through the product page, cart and address form cannot finish. Many will not report it. They just leave.
It also hides itself. Your traffic, add-to-cart and checkout-start numbers look healthy, and only the purchase count drops. Ad platforms then see no purchases and may optimise towards worse traffic.
Example: 100 shoppers start checkout each day. With a working widget 30 order. With the widget missing, none can.
How to check if your site has it
Open checkout in a private window
Add a product to the cart and go to the payment step. Use a private window with no extensions so cached files and ad blockers do not hide the problem.
Look for the widget
You should see card fields (Stripe) or a yellow or blue PayPal button. A blank gap, an endless spinner or missing payment methods means it is not rendering.
Open the browser console
Press F12 (or Cmd+Option+J on Mac), open Console and reload. Read the first red error. Look for messages such as 'Refused to load the script', 'Invalid API Key provided', 'Please call Stripe() with your publishable key' or 'Element not found'.
Check the Network tab
Filter by 'stripe' or 'paypal'. A blocked, red or missing request to
js.stripe.com/v3orpaypal.com/sdk/jsshows the script never loaded.Test on mobile and in another browser
Some failures only show on Safari, on mobile, or when a consent banner is declined.
| Cause | Clue in the console or Network tab |
|---|---|
| CSP blocks the script or iframe | 'Refused to load the script' or 'Refused to frame' mentioning js.stripe.com or paypal.com |
| Script blocked by consent tool or optimiser | Request to Stripe or PayPal never appears, or is delayed until after a click |
| Wrong or missing publishable key | 'Invalid API Key provided' or 'Please call Stripe() with your publishable key' |
| Test key on a live site (or the reverse) | Widget loads but payment methods are missing or errors on submit |
| Container element missing | 'Element not found' or 'Target container is not a DOM element' |
| PayPal client-id or currency wrong | PayPal SDK request returns 400, or button does not appear |
| JavaScript error earlier on the page | Another red error appears before the payment code runs |
How to fix it
Fix the cause the console shows. The steps below cover the common ones, then platform tabs show where to look in each tool.
Allow Stripe and PayPal in your CSP
If you send a Content-Security-Policy header or meta tag, add the payment domains (see the code below). Without them the browser silently refuses the script and iframe.
Exclude payment scripts from optimisation
Do not defer, delay, combine or minify Stripe.js or the PayPal SDK. Exclude them in your caching or speed plugin and in any consent tool.
Check the keys
Use the publishable key (starts with
pk_live_orpk_test_), never the secret key (sk_). Make sure live and test modes match the environment. For PayPal, check the client-id and that the currency matches your store.Make sure the container exists before mounting
The element Stripe or PayPal draws into must be in the page when the code runs. Mount after the DOM is ready, and again after your checkout re-renders it.
Fix earlier JavaScript errors
One uncaught error can stop the payment code from running. Fix or remove the failing script first.
Do not load the widget twice
Two copies of Stripe.js, or two PayPal SDK tags with different options, cause conflicts. Keep one.
script-src https://js.stripe.com https://www.paypal.com https://www.paypalobjects.com;
frame-src https://js.stripe.com https://hooks.stripe.com https://www.paypal.com;
connect-src https://api.stripe.com https://www.paypal.com;
img-src https://www.paypalobjects.com;<div id="payment-element"></div>
<script src="https://js.stripe.com/v3/"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var stripe = Stripe('pk_live_YOUR_PUBLISHABLE_KEY');
var elements = stripe.elements({ clientSecret: 'CLIENT_SECRET_FROM_YOUR_SERVER' });
elements.create('payment').mount('#payment-element');
});
</script>Exclude payment scripts from optimisation
In your caching or speed plugin, exclude js.stripe.com and paypal.com/sdk from delay, defer and combine settings. Clear the cache afterwards.
Check the gateway settings
In WooCommerce, go to Settings > Payments, open Stripe or PayPal and confirm the keys and the test or live mode.
Rule out plugin conflicts
Switch to a default theme and disable other plugins one by one on a staging copy. Check security plugins that add a CSP header.
Check Payments settings
In Settings > Payments, confirm Shopify Payments or PayPal is active and the account is not restricted or in test mode by mistake.
Check apps and custom code
Disable recently installed apps and review theme code or script tags that touch checkout. Shopify's own checkout loads payments itself, so a broken widget usually points at a custom or third-party checkout app.
Do not load payment scripts through a tag
If Stripe.js or the PayPal SDK is added as a Custom HTML tag, it may fire too late or be blocked by consent rules. Load it directly in the page instead.
Check triggers and consent settings
Make sure no tag or trigger removes or replaces the payment container on the checkout page.
Check the embed
If you use a custom code embed, confirm the container element and the script tag are both present and that the publishable key is correct.
Publish and test live
Some embeds do not render in the designer preview. Publish and test on the live domain.
Check the payment integration
In Payments > Integrations, confirm Stripe or PayPal is connected and in the right mode.
Check the order form element
Open the funnel page and confirm the order form or payment element is present and not hidden by custom CSS or code.
Check accepted payments
In Settings > Accept Payments, confirm the provider is connected and active.
Check custom embeds
If you added custom code, test with it removed to see if it interferes with the checkout.
Check Payments settings
In Commerce > Payments, confirm Stripe or PayPal is connected and not disconnected.
Check code injection
Under Settings > Advanced > Code Injection, remove recent scripts to see whether one breaks checkout.
Check headers
Inspect the Content-Security-Policy response header on the checkout page and add the Stripe and PayPal domains.
Check the mount code
Confirm the container exists, the key is correct, and the script loads once, from the official URL.
Before
- Blank space where the card form should be
- Console shows 'Refused to load the script'
- Checkout starts but no orders
After
- Card fields and PayPal button appear within a moment
- Console has no payment errors
- Orders and purchase tracking return
How to confirm it's fixed
- Card fields or PayPal button appear on checkout in a private window
- No red errors mentioning stripe or paypal in the console
- The requests to js.stripe.com or the PayPal SDK return status 200
- The widget works on mobile and in Safari as well as Chrome
- It still renders after declining the cookie banner
- A test payment (provider test mode) completes and the purchase event is recorded
How to prevent it happening again
- Test checkout after every theme, plugin, app or CSP change
- Keep payment scripts out of delay, defer and combine settings
- Store live and test keys separately and check them at each deploy
- Review CSP changes with the payment domains in mind
- Do not wrap the payment container in markup that your checkout re-renders
- Monitor checkout on a schedule instead of waiting for a drop in sales
Day 0
Example: a speed plugin update delays third-party scripts and the Stripe field stops drawing.
Day 1
Traffic and checkout starts look normal. Orders dip.
Day 3
Someone notices revenue is down and starts investigating.
Day 3 (later)
The script is excluded from delay and the widget returns.
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor runs your checkout journey on a schedule, from the EU or the US, and its payment methods check looks at whether the payment options actually appear at the payment step. If they do not, the step is marked as failed.
A failure is re-checked from a second region before one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. The robot stops before payment unless your store's test mode is set up, never enters real card details and never bypasses CAPTCHAs or bot protection. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans include a 3-day free trial.
Questions people ask
Why is my Stripe payment form not showing at checkout?
The most common reasons are a CSP that blocks js.stripe.com, a speed or consent tool that delays or blocks the script, a wrong publishable key, or a missing container element. Open the browser console on the checkout page and read the first error. It normally names the cause.
Why is my PayPal button not showing?
Check that the PayPal SDK request returns status 200 in the Network tab. A wrong client-id, an unsupported currency, a CSP that blocks paypal.com, or a script excluded by a consent tool are the usual causes. Also make sure the button container exists when the code runs.
How do I fix a Content Security Policy blocking Stripe?
Add the Stripe domains to your policy: js.stripe.com in script-src and frame-src, hooks.stripe.com in frame-src, and api.stripe.com in connect-src. Check Stripe's current documentation for the full list for the payment methods you use, then reload and check that the console error is gone.
Can a caching or speed plugin stop Stripe Elements from loading?
Yes. Options that delay, defer, combine or minify JavaScript can change when Stripe.js runs or stop it altogether. Exclude js.stripe.com and the PayPal SDK from those settings, clear the cache and test again.
Can I test the payment widget without a real card?
Yes. Use Stripe's or PayPal's test mode with their documented test details, or just check that the widget appears and stop before paying. You do not need a real card to confirm that it renders.
Why does the payment widget only fail for some visitors?
Browser extensions, privacy settings, consent banners, Safari restrictions and mobile networks can all block or delay the script for some people. Test in a private window, on mobile, and after declining cookies to reproduce it.
How can I know quickly if my checkout widget breaks?
Run a scheduled synthetic check that walks through checkout and confirms the payment options appear. FunnelGuard does this and alerts you with a screenshot and a likely cause, rather than you learning about it from lost sales.
Related issues
- PRF-099Third-party script fails to load (chat, form, payment widget)Fix guide
- PRF-100Third-party script slow and blocks renderingFix guide
- PRF-111Third-party script throws console errorsFix guide
- PRF-112Tag manager container fails to load (blocked, 404)Fix guide
- PRF-109Google reCAPTCHA fails to load, blocking form submitFix guide
- PRF-113Ad blockers break core functionality (site depends on blocked script)Fix guide