Why does my site throw Unexpected token < after a deploy?

Unexpected token < means the browser tried to parse HTML as JavaScript or JSON. The response often starts with markup and still has status 200, because a missing asset path returned the site page. Publish the hashed files and stop serving that page for missing asset paths. If the main script itself is HTML, the SDK never starts.

Last updated 26 November 2026. By Paul Badarau.

Bea, a fictional developer, deploys a photo studio site. The console shows SyntaxError: Unexpected token '<'.

  1. The parser wanted JavaScript or JSON and found markup. The body usually starts with a doctype or an html tag, and the status is often 200, because the server returned the site page for a path that should have been a file.
  2. Publish the hashed files from the new build. Stop returning the HTML page for missing asset paths. A long cache on those hashed files is safe. Keep the HTML fresh, so the page names files that exist.
  3. A source map of the real bundle does not explain a response that is not that bundle. It does show your JSON.parse line when your code parsed a body that was HTML. Open one occurrence when you need a frame from an earlier release. Opening the issue maps only the newest stored event.

If the main script itself is HTML, the SDK never loads and no event is sent. A later chunk that returns HTML can be reported when the SDK is already running. Owners and Administrators get one email the first time that fingerprint appears. The same fingerprint returning sends none, so the event count is the signal that the file is still missing.

The product page for this is Monitoring.

Start your 14-day free trial