On this page
What this issue is
The browser console is a log that every browser keeps for each page. When a script breaks, for example because it uses a variable that does not exist or a file fails to load, the browser writes a red error there. Visitors never see it, but the failed script may stop doing its job.
Why it costs you leads or sales
Not every console error hurts. Some are harmless noise from a widget. But an error on a funnel step can stop everything that runs after it in the same script. That may mean a form that does not validate or submit, a menu or button that does nothing, a payment widget that never loads, or an analytics or ad tag that never fires.
- Landing pageLoads normally
- Form stepScript throws an error
- SubmitHandler never runs
- Conversion tagNever fires
A failing script on the form step stops the submit handler and the conversion tag. Later steps never happen.
How to check if your site has it
Open the page in a private window
Use a private or incognito window with extensions off. This removes errors caused by your own ad blocker or browser add-ons.
Open DevTools
Press F12, or Ctrl+Shift+J (Windows/Linux) or Cmd+Option+J (Mac) in Chrome. Select the Console tab.
Reload and walk the funnel
Reload the page with the console open. Then do what a customer does: fill in the form, click the buttons, go to the next step. New errors can appear only after a click.
Read the red entries
Each error shows a message and a file name with a line number on the right. Click it to open the source. Note whether the file is yours, your theme, or a third party such as a chat or tracking script.
Check the Network tab for failed files
Filter by status. Red rows, such as 404 or blocked requests, show files that did not load. These often cause the matching console error.
How to fix it
The fix depends on whose script is failing. Start by working out which of these causes you have.
| Message | Usual cause | Typical fix |
|---|---|---|
| Cannot read properties of undefined | Code expects an element or value that is not on the page | Check the selector or load order; add a null check |
| x is not defined | A library or variable was not loaded before use | Load the library first or fix the script order |
| Failed to load resource: 404 | File was moved, deleted or the URL is wrong | Correct the URL or remove the reference |
| Blocked by CORS policy | Request to another domain lacks permission | Fix the server headers or the request |
| ERR_BLOCKED_BY_CLIENT | Your ad blocker blocked a tag | Retest without extensions; usually ignore |
Find the plugin or theme at fault
Click the file path in the console. Paths with /wp-content/plugins/name/ or /wp-content/themes/name/ tell you the source.
Isolate it
On a staging copy, deactivate plugins one at a time under Plugins > Installed Plugins and reload until the error goes. Back up first.
Update or replace
Update the plugin and theme. If the error stays, contact the author or swap the plugin. Also check minify or combine settings in your caching plugin, which can break scripts; turn off JS combine or delay options for the step.
Identify the source
Paths containing /cdn/shop/t/ are theme files. Paths from apps often come from another domain or an app embed.
Disable app embeds
In Online Store > Themes > Customize > App embeds, switch off suspect apps one at a time and recheck the console on a preview.
Fix or remove leftover code
Uninstalled apps can leave snippets in theme.liquid. Check Edit code and remove references to scripts that no longer exist. Duplicate the theme before editing.
Use Preview mode
Open Preview (Tag Assistant) and load the step. Check which tag was running when the console error appeared.
Fix Custom HTML tags
Custom HTML tags with invalid JavaScript are a common cause. Fix the code, or remove the tag if it is not needed.
Check triggers and variables
Errors about undefined values often come from a Custom JavaScript variable reading something that is not on the page yet. Return a safe fallback value or fire later.
Check custom code
Review Site settings > Custom code and the page's own custom code for the failing script.
Check selectors
If a script targets a class or ID you renamed in the Designer, update the selector or restore the name.
Republish
Publish the site and test the live URL, not the Designer preview.
Review custom code blocks
Check funnel step settings > Tracking Code and any Custom JS/HTML elements for broken or duplicated scripts.
Remove unneeded scripts
Delete old tracking or widget snippets that are no longer used, then save and republish the step.
Check added code
Open Settings > Custom code and review each snippet. Remove or fix the one named in the console.
Review embedded apps
Remove third-party apps or embeds that fail, and contact the app's support if you need them.
Check Code Injection
Open Settings > Advanced > Code Injection and review the header, footer and page-level code for errors.
Test without extensions
Disable injected scripts one at a time and recheck the console on the live page.
Use source maps
If you ship minified code, enable source maps so the console points to your original file and line.
Guard fragile code
Check that an element exists before using it, and wrap optional features so one failure does not stop the rest.
Fix the load order
Make sure libraries load before the code that uses them, using defer or correct script order.
const form = document.querySelector('#lead-form');
if (form) {
form.addEventListener('submit', handleSubmit);
}
// Keep optional features from breaking the funnel
try {
initChatWidget();
} catch (err) {
console.warn('Chat widget failed', err);
}Before
- Red TypeError on page load
- Submit handler never attached
- Form button looks fine but does nothing useful
After
- Console clear of errors from your own code
- Submit handler runs
- Lead and conversion tag both arrive
How to confirm it's fixed
- Reload the step in a private window and confirm no red errors from your own code or key scripts
- Click every button and submit the form; watch the console stay quiet
- Check the Network tab for failed (red) requests
- Confirm the conversion tag fires, for example in GTM Preview or the browser's Network tab
- Test on mobile as well as desktop
- Confirm the test lead reaches your inbox or CRM
How to prevent it happening again
Day 1
A plugin, theme or tag change is published
Day 1
A script now throws an error on the form step
Day 2-9
Nobody notices; the page looks normal (Example timing)
Later
Someone checks the console or a monitor flags it and the script is fixed
- Test the whole funnel with the console open after every plugin, theme or tag change
- Use a staging site for updates
- Remove scripts you no longer use
- Keep plugins, apps and themes updated
- Load third-party scripts so one failure cannot stop your form code
- Run scheduled checks so errors surface within a day, not weeks
How FunnelGuard handles this
FunnelGuard detects this today. Its robot visitor runs your funnel journeys on a schedule and uses a check named no_console_errors, which looks for JavaScript errors logged in the console while it loads and steps through each page. If a step shows errors, the check fails.
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 check tells you an error happened on a step; you still need to read it in DevTools to decide whether it matters. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.
Questions people ask
What is a console error on a website?
A console error is a red message the browser writes to its developer console when a script fails. Visitors do not see it, but the failed script may stop a form, button or tracking tag from working.
How do I see console errors in Chrome?
Open the page, press F12 (or Ctrl+Shift+J on Windows, Cmd+Option+J on Mac) and choose the Console tab. Reload the page and click through your funnel to catch errors that only appear after an action.
Do console errors affect conversions?
They can. If the error stops the form handler, a button or a conversion tag, you lose leads or tracking. Many errors are harmless noise, so test the step by hand to see if anything actually breaks.
Why do I see console errors only on my computer?
Browser extensions, especially ad blockers, often cause errors such as ERR_BLOCKED_BY_CLIENT. Open a private window with extensions off and check again. If the error disappears, it is local to your setup.
Why is my form not submitting and the console shows an error?
An earlier script error can stop the submit handler from being attached or from finishing. Read the error message and file path, then fix or remove that script. Retest the form with the console open.
How do I fix Uncaught TypeError: Cannot read properties of undefined?
It means code tried to use something that does not exist yet, often an element not on the page or a library not loaded. Check the selector and script load order, and add a check that the value exists before using it.
Can I ignore third-party script errors?
Only if they do not affect the funnel. Chat widgets and trackers can throw errors that break nothing, but if the failing script is a payment, form or conversion tag you should fix it, update it or remove it.
How can I monitor console errors automatically?
Run a scheduled test of your funnel that records console errors on each step. FunnelGuard does this with its no_console_errors check and alerts you with a screenshot and a likely cause.
Related issues
- PRF-116Uncaught JavaScript exception on page loadFix guide
- PRF-118Unhandled promise rejectionFix 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
- PRF-124CORS error blocking API call from the pageFix guide