{
  "id": 15166408,
  "title": "Why Your JSON Fails to Parse: Zero-Width Spaces Copied from ChatGPT",
  "url": "https://urgent.news/2026/10/17/why-your-json-fails-to-parse-zero-width-spaces-copied-from-chatgpt",
  "topic": "ai",
  "section": "AI",
  "published": "2026-10-17T09:28:26.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/brknbrkn/why-your-json-fails-to-parse-zero-width-spaces-copied-from-chatgpt-4p8k"
  },
  "original_language": "en",
  "account": "JSON parsing failures in Node and Python often stem from zero-width spaces copied from AI chat interfaces. These invisible characters -- U+200B, U+200C, U+200D, U+2060, U+FEFF, and U+00A0 -- do not affect the content of the answer but can cause parsing errors when pasted into source code. In Node, a BOM or U+200B at the beginning of a file results in a SyntaxError, while Python raises a SyntaxError for non-printable characters like U+200B. Zero-width spaces are not tied to the content and can appear in JSON strings, causing issues with config[ name ] returning undefined due to the actual key being name\\u200B. They can be identified using shell commands or in programming languages like Python and Node by mapping code points to their hexadecimal representations and filtering out unwanted characters. When cleaning up the text, it's essential to preserve ZWJ between emoji to maintain the integrity of family emojis.",
  "summary": "You ask ChatGPT for a config snippet. You copy it, paste it into your editor, and compare it with the file that works. The two look identical, character for character. Then you run it. In Node, a pasted file that starts with a byte order mark gives you this (the invisible character is written here as <U+FEFF> ; your terminal prints nothing at that position): SyntaxError: Unexpected token…",
  "key_points": [
    "Zero-width spaces copied from AI chat cause JSON parsing failures.",
    "Different zero-width characters affect Node and Python parsing.",
    "Cleaning text preserves ZWJ between emojis for family emojis."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}