Could a proxy server or CDN cause a "SyntaxError: Unexpected token '<'" when parsing JSON?

Responsive Ad Header

Question

Grade: Education Subject: Support
Could a proxy server or CDN cause a "SyntaxError: Unexpected token '<'" when parsing JSON?
Asked by:
90 Viewed 90 Answers
Responsive Ad After Question

Answer (90)

Best Answer
(388)
Yes, a proxy or CDN could be a cause. They might be intercepting the request and returning an error page (HTML) if the origin server is unavailable or experiencing issues. They might also inject their own HTML content (like a caching error message) into the response. Debug by directly connecting to the origin server (if possible) to bypass the proxy/CDN and see if the problem persists.