Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#8,017 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
92/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
领域
documentation

调研方向

编辑 docs/guide.md 中反向代理部分,在第 279 行附近现有的 Cloudflare Access 引用旁进行修改。先检查周围的措辞和建议的 Rocket Loader 配置规则,然后添加说明:对于 code-server 主机名,必须禁用它。完成标准是指南清楚地说明空白页面的症状以及按主机名限定范围的 Cloudflare 设置。

由索引模型根据 Issue 内容生成。

描述

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).

主要语言
TypeScript
星标
79.4k
派生
6.9k
平均合并
2 天 13 小时
30 天内合并 PR
39

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

coder/code-server 的其他 Issue

查看 coder/code-server 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。