Skip to content

Node 26 / undici 7 / gziped responses bug #318

Description

@tom111

I installed todoist-cli today and could not get it to work with td auth login failing after showing success in the browser and other unsuccessful API response parsing. I let claude code diagnose the issue and below is what it came up with.

You can probably take it from here with your own claude. Let me know if you need anything else from me (the human) or if such bug reports are not suitable here.

On Node 26 / undici 7, @doist/todoist-cli@1.62.0 cannot parse any gzip-encoded
response from the Todoist API. Every command that calls a gzipped endpoint fails
with a Zod validation error against the response shape, even though the API
returned 200 OK with valid JSON in the body.

The cause is in @doist/todoist-sdk (currently 10.1.2): it installs an
EnvHttpProxyAgent from undici as the dispatcher for every fetch() call, and
on Node 26 that agent does not include the gzip-decompression interceptor that
Node's default fetch dispatcher uses. Compressed bytes reach JSON.parse,
parsing fails silently, and the SDK's try/catch falls back to assigning the
raw text to response.data. Subsequent destructuring (data.results,
data.fullName, …) produces undefined, which Zod then rejects at the root.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions