Request error `Premature close` when using API
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- node.js, typescript
- Domain
- api
Research direction
Start by reproducing cloudflare.pages.projects.edit with Node 24.17.0, then trace the request and response handling associated with the Premature close error in the stack trace. Done means the edit request completes without ERR_STREAM_PREMATURE_CLOSE and the behavior is covered by a regression check.
Written by the indexing model from the issue text.
Description
Confirm this is a TypeScript library issue and not an underlying Cloudflare API issue
- This is an issue with the TypeScript library
Describe the bug
Getting error when using cloudflare.pages.projects.edit:
FetchError: Invalid response body while trying to fetch https://api.cloudflare.com/client/v4/accounts/***/pages/projects/<PROJECT_NAME>: Premature close
at Gunzip.<anonymous> (/home/runner/work/<some_path>/node_modules/node-fetch/lib/index.js:400:12)
at Gunzip.emit (node:events:521:24)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
type: 'system',
errno: 'ERR_STREAM_PREMATURE_CLOSE',
code: 'ERR_STREAM_PREMATURE_CLOSE'
}
To Reproduce
Use cloudflare.pages.projects.edit in Node 24.17.0
Code snippets
OS
Ubuntu
Runtime version
Typescript 6.0.3
Library version
v6.4.0
- Dominant language
- TypeScript
- Stars
- 835
- Forks
- 201
- Avg merge
- 41m
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/cloudflare-typescript
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/cloudflare-typescript#2821 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
cloudflare/cloudflare-typescript#2811 ·
-
workers.scripts.deployments.list() paginates the wrong field in v7.2.0Possibly taken @airshakur88 claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cloudflare/cloudflare-typescript#2805 · 1 comment · 1 reaction ·
-
Release CalendarOpen
Difficulty 1/5 Under an hour Newbie friendliness 68/100
cloudflare/cloudflare-typescript#2755 · 7 comments · 1 reaction ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 15/100
cloudflare/cloudflare-typescript#2812 ·
All issues in cloudflare/cloudflare-typescript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
siyuan-note/siyuan#21692 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GetStream/stream-chat-react#3467 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
resend/resend-node#1206 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel-labs/ui#1139 ·
Maintainers usually reply within 1 day