On this page
What this issue is
JavaScript keeps gaining new syntax. Optional chaining (user?.address), nullish coalescing (a ?? b), logical assignment (a ||= b) and class fields are examples. Browsers released before a feature shipped do not understand it.
This is different from a missing API, where the code parses but a function is absent. With new syntax, the browser fails at parse time. It shows a SyntaxError such as Unexpected token '.' or Unexpected token '?', and none of the code in that file runs. Your site looks fine on your own up-to-date laptop, so the problem stays hidden.
const city = lead?.address?.city ?? 'unknown';
settings.retries ||= 3;Why it costs you leads or sales
When the main bundle fails to parse, everything it controls goes with it: form validation and submission, add-to-cart buttons, chat widgets, consent banners and tracking tags. The page still renders, so visitors do not see an error. They just find a form or button that does nothing.
The damage is partial, which makes it easy to miss. Only visitors on older phones, old tablets, corporate machines or unupdated devices are affected. Your overall conversion rate dips a little and no alert fires. Impact is medium because the share of affected visitors depends on your audience.
- Visitor opens pageOld browser loads HTML and CSS fine
- Script downloadsFile contains ?. or ??
- Parse failsSyntaxError: Unexpected token
- Form and buttonsHandlers never attached
- Tracking and leadNo conversion hit sent
One unparseable line stops the whole script, so everything after it is lost.
Example: illustrative numbers showing how one group of older browsers can convert far worse while the overall average hides it.
How to check if your site has it
Check your analytics by browser version
In GA4, open Reports > Tech > Tech details and choose Browser (or Operating system with version). Look for versions whose conversion rate is far below the rest.
Test in a real older browser
Use an older iPhone or Android device, or a browser-testing service that offers older versions. Open your key page, open the form and try to submit.
Read the console
Look for
SyntaxError: Unexpected token. The error names the script file and line, which tells you which bundle or third-party script contains the modern syntax.Scan your built files
Search your production JavaScript for
?.and??. If they appear in the output, nothing converted them.Check error monitoring
If you use a browser error tracker, filter for SyntaxError grouped by browser version.
grep -rnE "\?\.[a-zA-Z_\[(]| \?\? " dist/ --include=*.js | headHow to fix it
There are two routes: convert the syntax at build time (transpiling), or serve a script that already avoids it. Which one applies depends on how your site is built.
Set a browserslist target
Add a
browserslistentry in package.json (or a .browserslistrc file) that includes the browsers your visitors use, for exampledefaultsplusiOS >= 12. Pick the range from your own analytics.Transpile with Babel, SWC or esbuild
With Babel use @babel/preset-env so it reads the browserslist and rewrites
?.and??. With esbuild set thetargetoption, for example--target=es2017.Transpile your dependencies too
Many bundlers skip node_modules. If a library ships modern syntax, include it in your transpile rules. Check the console error's file name to find it.
Rebuild and redeploy
Purge your CDN cache so visitors do not receive the old bundle.
Find the script named in the error
The console error shows a file path. It usually sits under /wp-content/plugins/ or /wp-content/themes/.
Update the plugin or theme
Check for an update. If the vendor still ships untranspiled code, contact them or replace the plugin.
Review your own custom scripts
If a snippet or child theme file uses
?.or??, rewrite it with plain checks such asa && a.banda !== null && a !== undefined ? a : b.Clear caches
Clear your caching plugin and CDN so the fixed file is served.
Find the offending Custom HTML tag or variable
Custom JavaScript variables and Custom HTML tags run in the visitor's browser. Check the preview-mode console for the SyntaxError.
Rewrite with older syntax
GTM's Custom JavaScript variables are best written in plain ES5: use
functionandvar, and avoid?.,??and arrow functions.Publish a new version
Test in Preview mode first, then publish.
Locate the script
Check the console error's file. Theme files are under assets/, app scripts are served from app domains.
Fix your theme code
In Online Store > Themes > Edit code, rewrite modern syntax in your own theme JS using plain checks.
Deal with apps
If an app's script is the cause, report it to the app developer or remove the app.
Check custom code areas
Review Project settings > Custom code and any embed elements for
?.or??.Rewrite with older syntax
Replace modern syntax with plain conditionals, then publish.
Review third-party embeds
If a vendor script is the source, contact the vendor.
var city = (lead && lead.address && lead.address.city != null)
? lead.address.city
: 'unknown';
if (!settings.retries) { settings.retries = 3; }{
"browserslist": [">0.5%", "last 2 versions", "not dead", "iOS >= 12"]
}Before
- Built file still contains ?. and ??
- Old browsers throw SyntaxError
- Forms and tags silently dead for those visitors
After
- Build targets your real browser range
- Syntax converted to older equivalents
- Forms and tags run on old and new browsers
How to confirm it's fixed
- Open the page in an older browser or device: no SyntaxError in the console
- Submit the form and confirm the lead arrives
- Check the conversion tag fires in the network tab
- Search the built files again: no untranspiled
?.or??in your own code - Confirm the CDN serves the new file, not a cached one
- Watch GA4 conversion rate for older browser versions over the next days
How to prevent it happening again
Keep a single browserslist target and have the build read it. Add a build step that fails if the output contains syntax beyond your target, such as ESLint with the eslint-plugin-compat or es-check tool. Re-check older browsers after adding any new plugin, app or vendor script, because those can bring new syntax with them.
npx es-check es2017 'dist/**/*.js'Day 0
A developer or plugin update introduces `?.` in a bundle.
Day 0
Tests on current browsers pass. Release goes live.
Day 1
Visitors on older browsers hit a SyntaxError. Forms do nothing.
Week 2
Someone notices a small dip in conversions for certain browsers.
Week 2
Transpile target is set and the site is redeployed.
How FunnelGuard handles this
FunnelGuard does not check for this yet. A check for syntax errors on older browsers is a possible future addition, not a current feature.
What FunnelGuard does do is run your real customer journeys on a schedule with a robot visitor, from the EU or the US. It checks that each step works, that tracking hits reach platforms like GA4, Google Ads and Meta, and that test leads arrive in your inbox and CRM. If a script error breaks a form or a tag for the robot's browser, the failed step is re-checked from a second region and you get one alert with a screenshot and a likely cause. That covers errors that hit modern browsers, but not ones that appear only in old browsers.
To watch for the old-browser case today, combine these: segment GA4 conversions by browser version, use a browser error tracker that reports SyntaxError by browser, run es-check in your build, and test key forms on an older device after each release.
Questions people ask
Why does my website work in Chrome but not on an older browser?
Your code probably uses modern syntax, such as optional chaining (?.) or nullish coalescing (??), that older browsers cannot parse. The browser throws a SyntaxError and refuses to run the entire script file. Transpile your code to a target that matches your visitors' browsers.
What does 'SyntaxError: Unexpected token' mean on an old browser?
It means the browser met syntax it does not understand, such as ?.. Unlike a missing function, this stops the whole file from running. The error message names the file and line, so you can find the source.
How do I fix optional chaining not working in older browsers?
Transpile your JavaScript with Babel, SWC or esbuild using a browserslist or target that includes the older browsers. Also transpile any dependencies that ship modern syntax. Alternatively, rewrite the line using plain checks like a && a.b.
Do I need to support old browsers at all?
It depends on your audience. Check your analytics for browser and OS versions, then support the range that carries real traffic. If older versions bring leads or sales, a broken form there has a direct cost.
How can I test my site in an older browser?
Use a real older phone or tablet, or a cross-browser testing service that offers older browser versions. Open the console, load your funnel pages, submit the form and check for SyntaxError. Also compare conversion rates by browser version in GA4.
Can Google Tag Manager cause JavaScript errors on old browsers?
Yes. Custom HTML tags and Custom JavaScript variables run in the visitor's browser, so modern syntax in them can fail. Write GTM custom JavaScript in plain ES5 and test in Preview mode.
Does FunnelGuard detect JavaScript errors on old browsers?
No, not yet. It is a possible future check. FunnelGuard does run your real journeys and check forms, tracking hits and lead delivery, so it catches breaks that affect its own test browser, but not errors that appear only in older browsers.
Related issues
- PRF-127JS error only in Safari (unsupported API)Fix guide
- PRF-116Uncaught JavaScript exception on page loadFix guide
- PRF-117Console error on a funnel stepFix guide
- PRF-120JS error only after clicking submit breaks the formFix guide
- PRF-134Button does nothing on click (dead click)Fix guide
- PRF-129Deprecated API warnings (document.write, sync XHR)Fix guide