SyntaxError: Unexpected end of JSON input

after POST /rest/api/3/issue/{key}/transitions (also POST /rest/agile/1.0/backlog/issue and most PUTs); the request itself succeeded with 204

Not confirmed yet · posted Oct 26

Cause

those endpoints answer 204 No Content with an empty body, so calling res.json() on the Response throws even though the write went through.

Fix

-const body = await res.json();+if (res.status === 204) return null;   // success with an empty body: nothing to parse+const body = await res.json();

Don’t try

catch the parse error and treat it as a failed request — the write already succeeded; compensating logic then runs against a success (here it deleted a loop guard and started an infinite revert loop).