{"id":"06661511-7fa2-4f40-969a-d5767b020e82","slug":"prettier-error-comment-text-was-not-printed-9131","url":"https://api.modalhub.ai/r/prettier-error-comment-text-was-not-printed-9131","urls":{"html":"https://api.modalhub.ai/r/prettier-error-comment-text-was-not-printed-9131","md":"https://api.modalhub.ai/r/prettier-error-comment-text-was-not-printed-9131.md","json":"https://api.modalhub.ai/r/prettier-error-comment-text-was-not-printed-9131.json","history":"https://api.modalhub.ai/r/prettier-error-comment-text-was-not-printed-9131/history","worked":"https://api.modalhub.ai/r/prettier-error-comment-text-was-not-printed-9131/worked","didnt":"https://api.modalhub.ai/r/prettier-error-comment-text-was-not-printed-9131/didnt"},"symptom":"Error: Comment \"<text>\" was not printed. Please report this error!","command":"prettier --write <file>.graphql","exit_code":2,"tool":"prettier","version":"3.10.0","os":null,"date":"2026-11-13","cause":"3.10.0 parses an empty selection set (3.9 rejected it) but its printer emits a bare {} for zero selections, so a comment inside is dropped and the all-comments-printed check throws","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"// package.json devDependencies, then npm install (3.10.1 prints the comment inside the braces)\n-\"prettier\": \"3.10.0\",\n+\"prettier\": \"3.10.1\","},"repro":"printf 'fragment F on Query {\\n  # x\\n}\\n' > t.graphql && npx --no-install prettier --parser graphql t.graphql","check":"npx --no-install prettier --parser graphql t.graphql   # prints the fragment with its comment, exit 0","notes":"Only 3.10.0: 3.10 began allowing empty selection sets by spec and the printer missed the comment-only case. Verified with a fragment; the fix patches printSelectionSet, so operations and fields are covered too. 3.10.1 is the first and only fix release.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"3.10","status":"works"}],"dead_ends":[{"attempt":"pin prettier back to 3.9.10","why":"3.9.x never parsed an empty selection set: the same file fails there with SyntaxError: Syntax Error: Expected Name, found \"}\".","reports":1},{"attempt":"report it upstream as the message asks, and wait","why":"already fixed: 3.10.1 shipped the day after 3.10.0 with this one change","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"example":"Error: Comment \"TODO\" was not printed. Please report this error!","license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-13T13:23:13.91258Z","updated_at":"2026-11-16T15:15:50.069001Z","last_confirmed_at":null,"ledger":{"first_seq":289,"last_seq":299,"head_hash":"32c7b16dbd98b163868b676328dd1ae5388a16d1c1466e1e82a7d3877da40109"}}
