Request error `Premature close` when using API

Đang mở
#2,785 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
node.js, typescript
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện cloudflare.pages.projects.edit với Node 24.17.0, sau đó lần theo việc xử lý request và response liên quan đến lỗi Premature close trong stack trace. Công việc được xem là hoàn tất khi request chỉnh sửa hoàn thành mà không có ERR_STREAM_PREMATURE_CLOSE và hành vi này được bao phủ bởi một kiểm tra hồi quy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
835
Fork
201
Merge trung bình
41 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cloudflare/cloudflare-typescript

Tất cả issue của cloudflare/cloudflare-typescript

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.