On this page
What this issue is
Every browser supports a slightly different set of built-in features, called APIs. If a script calls one that Safari lacks, Safari throws an error and stops running that script. Chrome and Firefox may run the same code without trouble.
Typical Safari messages look like TypeError: undefined is not a function, ReferenceError: Can't find variable: ResizeObserver or TypeError: x.replaceAll is not a function. The wording differs from Chrome, which is why searching for a Chrome error text often finds nothing.
Common culprits are newer or less common APIs: requestIdleCallback, structuredClone or Array.prototype.at on older iOS versions, lookbehind in regular expressions, Intl features, some date parsing formats, and new Date('2024-01-05 10:00') style strings that Safari rejects. Safari on iPhone uses the same engine in every iOS browser, so Chrome on iOS fails too.
Why it costs you leads or sales
When a script stops at an error, everything after it never runs. That can be a form validator, a submit handler, a payment button, a cookie banner or a tracking tag. Visitors see a button that does nothing, or the form submits but no conversion is recorded.
Because you and your team probably test in Chrome on a desktop, the problem stays hidden. Safari visitors, who are often a large share of mobile traffic, quietly drop off while your reports show a vague dip in conversion rate.
- Ad clickVisitor arrives on an iPhone
- Landing page loadsPage renders normally
- Script calls unsupported APISafari throws an error
- Form submitHandler never attached
- Conversion tagNever fires
The error happens early, so every later step on Safari never runs.
Example: the same landing page converts well in Chrome but poorly in Safari after a script error. Numbers are illustrative.
How to check if your site has it
Enable the Develop menu
On a Mac, open Safari > Settings > Advanced and tick 'Show features for web developers' (older versions: 'Show Develop menu in menu bar').
Open the console
Load the affected page, then choose Develop > Show JavaScript Console (or press Option+Command+C). Reload and click through the form or checkout.
Read the error and file
Note the message, the file name and the line number. Check whether the file is your own code, a theme, or a third-party script.
Test on an iPhone
Connect an iPhone with a cable, enable Settings > Safari > Advanced > Web Inspector on the phone, then choose the device in the Mac's Develop menu to see its console.
Compare with Chrome
Run the same journey in Chrome. If Chrome shows no error and Safari does, you have a Safari-only failure.
How to fix it
The right fix depends on whether the failing call is in your own code, a plugin or theme, or a third-party script. Start by checking the API on a compatibility reference such as MDN's browser support table or caniuse.com.
Identify the exact call
From the console line number, find the function or property Safari does not recognise.
Add a feature check
Test whether the API exists before using it, and fall back to something simpler if not.
Or add a polyfill
A polyfill is a small script that supplies the missing feature. Load it before the code that needs it.
Transpile modern syntax
If the error is a syntax or method issue, set your build tool's browser targets (for example a browserslist including Safari 14 or the iOS versions you support) so it converts newer code.
Update or replace the third-party script
If the error is inside a vendor file, update the plugin or tag to the latest version, or contact the vendor with the Safari version and error text.
// Example: requestIdleCallback is missing in Safari
const runLater = window.requestIdleCallback
? (fn) => window.requestIdleCallback(fn)
: (fn) => setTimeout(fn, 1);
runLater(() => {
initTracking();
});
// Example: replaceAll on older Safari
const clean = (s) => s.split('-').join(' ');try {
initFancyWidget();
} catch (e) {
console.error('Widget failed', e);
}
// The form handler below still runs
initFormHandler();Find the source file
The console file path shows /wp-content/plugins/... or /wp-content/themes/.... That tells you which plugin or theme is responsible.
Update or swap
Update the plugin or theme. If the error remains, deactivate it on a staging copy to confirm, then replace it or ask the author for a fix.
Add a fallback for custom code
For your own snippets, use a child theme or a code snippets plugin and add the feature check shown above.
Locate the script
Check whether the file is in your theme (Online Store > Themes > Edit code > assets) or an app's script.
Patch the theme
Add the feature check to the theme JavaScript. Work on a duplicate theme and preview it in Safari first.
Update or remove the app
If an app causes it, update it, contact its support, or remove it.
Find the faulty tag
Use Preview mode in Safari. Look for a Custom HTML tag or Custom JavaScript variable that throws.
Rewrite it
Replace the unsupported call with a feature-checked version, or use ES5 syntax (var, function) inside Custom JavaScript variables.
Publish and re-test
Publish a new version and reload the page in Safari to confirm tags fire.
Check custom code
Look in Project Settings > Custom Code and in page-level custom code embeds for the failing script.
Add the guard
Wrap the call in a feature check or try/catch and republish.
Review custom JS
Check the funnel or website Custom Code area and any custom JavaScript elements on the page.
Patch and publish
Add the feature check, save, publish and test the funnel in Safari.
Check added code
In Settings > Custom Code, look at scripts you added. Wix Velo page code may also use unsupported calls.
Fix or remove
Add a fallback in the code, or remove the script if you do not need it.
Check injected code
Open Settings > Developer Tools > Code Injection and any Code Blocks on the page.
Patch the script
Add a feature check, save and test in Safari.
Set browser targets
Set a browserslist (for example in package.json) that includes the Safari and iOS versions you support, so Babel or your bundler transpiles syntax.
Add polyfills only where needed
Use core-js or a targeted polyfill for missing methods, loaded before your main bundle.
Ship source maps
Source maps make Safari stack traces readable, so the next error is faster to trace.
How to confirm it's fixed
- Safari console shows no red errors on the landing page, form and thank-you page
- The form submits and the test lead reaches your inbox or CRM
- Conversion tags fire after submit (check in each ad platform's test view or in Tag Manager Preview)
- The same journey works on an iPhone, not only on desktop Safari
- Chrome and Firefox still work as before
Before
- Console shows TypeError in Safari
- Submit button does nothing
- Conversion tag never fires
After
- Feature check or polyfill in place
- Form submits and shows confirmation
- Conversion tag fires once
How to prevent it happening again
- Test every release in real Safari on desktop and iPhone, not just Chrome
- Set and document the browser versions you support
- Check MDN or caniuse.com before using a new API
- Keep plugins, themes and tag templates updated
- Review new third-party scripts in Safari before adding them
- Monitor key journeys on a schedule so a bad deploy is caught quickly
How FunnelGuard handles this
FunnelGuard detects this issue. A robot visitor runs your real journeys, such as a lead form or checkout, on a schedule, including in Safari. During those runs it records console errors, so a no_console_errors check fails when Safari logs an error, and it flags steps that fail in one browser but not another.
A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. FunnelGuard tells you that Safari hit an error and on which step. You still need to read the message and apply the code fix yourself.
The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month and include a 3-day free trial. A free read-only website audit is also available.
Questions people ask
Why does my website work in Chrome but not in Safari?
Safari uses the WebKit engine and supports a different set of browser features than Chrome. If your code or a plugin calls an API Safari lacks, it throws an error and stops that script. Open Safari's Web Inspector console to see the exact message.
How do I see JavaScript errors in Safari?
Enable the Develop menu in Safari > Settings > Advanced, then choose Develop > Show JavaScript Console and reload the page. For an iPhone, turn on Settings > Safari > Advanced > Web Inspector and connect it to a Mac.
Why is my form not submitting on iPhone?
A JavaScript error that stops the submit handler from loading is a common cause, especially if the form works in Chrome on desktop. Other causes include a covered button or a required field that cannot be completed. Check the console in Safari first.
Does Chrome on iPhone use Safari's engine?
Yes. Apple requires browsers on iOS to use WebKit in most regions, so Chrome and Firefox on an iPhone behave much like Safari. A Safari-only bug often affects every iPhone visitor.
What does 'undefined is not a function' mean in Safari?
It means the code called something as a function that does not exist in Safari, often a newer built-in method. Look at the file and line in the console, then add a feature check or a polyfill.
What is a polyfill and do I need one?
A polyfill is a small script that adds a feature a browser is missing, so your code can use it everywhere. You need one when you rely on an API that your supported Safari versions lack and you cannot avoid it.
Can a Safari-only error stop my ad conversions being tracked?
Yes. If the error happens before the tracking tag runs, or inside it, the conversion is never sent. Your ad platform then under-reports Safari conversions.
How can I catch Safari errors automatically?
Run your key journeys on a schedule in Safari and record console errors. FunnelGuard does this and alerts you with a screenshot and likely cause when a step fails or an error appears.
Related issues
- PRF-128JS error only on old browsers (optional chaining, etc.)Fix guide
- PRF-117Console error on a funnel stepFix guide
- PRF-116Uncaught JavaScript exception on page loadFix guide
- PRF-120JS error only after clicking submit breaks the formFix guide
- PRF-134Button does nothing on click (dead click)Fix guide
- PRF-135Form submits but shows no feedback (silent failure)Fix guide