Troubleshooting

Use the browser console to debug errors

Reviewed on 5 min read debugging browser

When a button does nothing, a form does not submit or a page looks broken, the cause almost always shows up in the browser's developer tools. They all have the same two tabs we are going to use: Console and Network.

Open the tools

  • Firefox: Ctrl + Shift + K (Command + Option + K on macOS) opens the Console.
  • Chrome and Edge: Ctrl + Shift + J (Command + Option + J on macOS) opens the Console.
  • Any browser on Windows or Linux: F12 opens the tools; then choose the tab.
  • Safari: first enable Safari > Settings > Advanced > Show features for web developers. Then press Command + Option + C.

A panel like this one will open (Firefox in the screenshot):

Firefox developer tools open at the bottom of the page

Console

The Console shows the page's errors and warnings: JavaScript failures, resources blocked because they do not use https, encoding problems, and so on. Errors appear in red and warnings in yellow.

Firefox Console tab with error messages

To find the error you are interested in:

  1. Click the bin icon to clear the previous messages.
  2. Repeat what fails once (click the button, submit the form…).
  3. Look at the first red error that appears. On the right you have the file and line that cause it.

The most common messages and what they mean:

  • Uncaught TypeError / Uncaught ReferenceError: a fault in a script. The file on the right tells you which plugin, theme or module it comes from (for example wp-content/plugins/NOMBRE/...). Try updating or disabling it.
  • Mixed Content: the page loads over https but some resource (image, script, CSS) is requested over http. The browser blocks it. Change that URL to https in the website's settings or content.
  • blocked by CORS policy: the website is trying to read data from another domain that does not allow it. It usually happens after changing domain or switching from www to non-www: check that the website URL in the application's settings is the one you use.
  • Failed to load resource: the server responded with a status of 404 (or 403, 500): a file could not be loaded. Look for it in the Network tab to see which one it is.

If the page redirects you to another one when it fails, tick Persist Logs (Firefox) or Preserve log (Chrome) so the messages are not cleared.

Network

The Network tab shows every request the page makes: the HTML, images, scripts, stylesheets and the internal calls made by buttons and forms. For each one you see the status, the method (GET or POST), the size and how long it took. The page total appears at the bottom.

Firefox Network tab with the list of requests and the page total

To use it:

  1. Open the Network tab before reproducing the problem.
  2. Tick Disable Cache (Firefox) or Disable cache (Chrome) to see the real load.
  3. Reload the page or repeat the action that fails.
  4. Look for rows in red or with a 4xx or 5xx status. If a button or form fails, filter by XHR (Firefox) or Fetch/XHR (Chrome).
  5. Click the request and open Response: it often contains the full error message.

What each status means:

  • 404: the file does not exist at that path. Check the URL or upload it.
  • 403: the server does not allow access. It may be a file permission, a .htaccess rule or the firewall.
  • 500: an application error on the server. The exact message is in the PHP error log: enable the PHP error log.
  • 502, 503 or 504: the server took too long or was overloaded. Look at the time column.

To find out why a website is slow, sort by the Time or Size column: you will see which image is too heavy or which request takes several seconds.

Send the error to support

If you open a ticket with us, include the URL, the time, what you did and a screenshot of the Console error or of the Network request with its Response. Before sharing a HAR file exported from Network, bear in mind that it includes your session cookies: a screenshot is better.

The Console also lets you run JavaScript code. Never paste code that someone asks you to by email or chat: it is a common technique for stealing sessions.

You may also find useful

Something wrong or out of date? Tell us and we will review it.