Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Document that Cloudflare Rocket Loader must be disabled (blank page, third report)

Đang mở Phù hợp với người mới
#8,017 2 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ó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
92/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
documentation

Hướng nghiên cứu

Chỉnh sửa phần reverse proxy của docs/guide.md, gần tham chiếu Cloudflare Access hiện có ở khoảng dòng 279. Trước tiên, hãy xem lại cách diễn đạt xung quanh và quy tắc cấu hình Rocket Loader được đề xuất, sau đó thêm hướng dẫn rằng phải tắt nó đối với các hostname của code-server. Hoàn thành khi hướng dẫn giải thích rõ triệu chứng trang trống và cài đặt Cloudflare được giới hạn theo hostname.

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

Mô tả

What is your suggestion?

Document that Cloudflare's Rocket Loader must be disabled for hostnames serving code-server, in the reverse-proxy section of docs/guide.md (which already references Cloudflare Access around line 279).

Suggested wording:

Cloudflare users: disable Rocket Loader for your code-server hostname. Rocket Loader rewrites inline <script> tags at the edge, which code-server's Content Security Policy blocks, resulting in a blank page with no visible error. Scope it with a Configuration Rule rather than disabling it zone-wide:

Expression: (http.host eq "code.example.com")
Setting:    Rocket Loader → Off

How will this improve the docs?

This failure has now been reported three times (#1451, #4164, and my own investigation below), always as "white screen behind Cloudflare". It is hard to self-diagnose: every asset returns HTTP 200, the server logs look healthy, and the only symptom is an empty <body> plus a CSP error that does not mention Cloudflare.

The failure became easier to hit in recent releases. Comparing the CSP script-src emitted by two versions:

4.130.0 (loads) 4.138.0 (blank)
nonce 'nonce-1nline-m4p' (static literal) random per request
sha256 hashes 5 2

With a static nonce, Rocket Loader's injected inline scripts copy the nonce out of the surrounding markup and still validate. With a per-request nonce and a shorter hash list they do not, so CSP blocks them and the AMD loader fails with Cannot determine URI for module id!.

I reproduced this on two independent machines behind separate Cloudflare Tunnels. Both worked on 4.130.0 and broke immediately after upgrading to 4.138.0, with no Cloudflare configuration change in between. Disabling Rocket Loader for those hostnames fixed both, with no change to the origin.

The underlying CSP change is upstream, not code-server's — patches/csp-hashes.diff is byte-identical between v4.130.0 and v4.138.0, and code serve-web 1.138.0 fails the same way with no code-server in the path. I filed that separately as microsoft/vscode#337226. This request is only about documenting the interaction, since code-server users are the ones who predominantly hit it.

One related note: in #1451 a maintainer mentioned adding "the proper tags so our scripts don't get rocket-loaded by default". That does not appear to be in effect on 4.138.0 — all six bootstrap script tags are still rewritten to type="<hash>-text/javascript". If that mitigation is still wanted, it would remove the need for the docs change; otherwise documenting the workaround seems like the cheaper fix.

Are you interested in submitting a PR for this?

Yes, happy to open a PR against docs/guide.md if you would like the wording above (or something closer to your house style).

Ngôn ngữ chính
TypeScript
Star
79.4k
Fork
6.9k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
39

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 coder/code-server

Tất cả issue của coder/code-server

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.