Fix “Unexpected token <” when fetch expects JSON
Trace a fetch JSON parse error to an HTML response. Use status, redirect history and content type to distinguish a login page, a missing route and a fallback.
Software Engineering3 min read
Tag
4 articles with this tag.
Trace a fetch JSON parse error to an HTML response. Use status, redirect history and content type to distinguish a login page, a missing route and a fallback.
Software Engineering3 min read
Fix btoa InvalidCharacterError for Unicode text, see why café can silently encode to the wrong bytes, and round-trip UTF-8 with TextEncoder and TextDecoder.
Software Engineering3 min read
Decode the same Unix timestamp as seconds and milliseconds, verify the UTC result, and handle zero, negative values and numeric strings in JavaScript.
Software Engineering3 min read
Reproduce a React hydration mismatch with UTC and Kathmandu dates, render a stable first timestamp, and test local formatting at a midnight boundary.
Software Engineering4 min read