Conversation
Rocket Loader rewrites inline script tags at the edge and re-injects them without the CSP nonce, so the browser blocks them and the page renders blank with no actionable error. Document the Configuration Rule that scopes Rocket Loader off for the code-server hostname. Refs coder#8017, coder#1451, coder#4164, microsoft/vscode#337226 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8017
Documents that Cloudflare's Rocket Loader must be disabled for hostnames serving code-server.
Why
Rocket Loader rewrites inline
<script>tags at the edge and re-injects them from its own loader. The re-injected elements do not carry the CSP nonce, so the browser blocks them and the workbench never boots. The symptom is a blank page: every request returns HTTP 200, the server logs look healthy, and the only console output isCannot determine URI for module id!.It is hard to self-diagnose, and has now been reported three times over six years (#1451, #4164, #8017).
Upstream status
The CSP change is upstream, not code-server's. It landed in microsoft/vscode@90c5812 as a security fix: the old policy used a fixed literal nonce and computed its SHA-256 hashes over the fully rendered document, both of which weakened it to roughly
'unsafe-inline'. Dropping the inline bootstrap hashes was a side effect.Upstream declined to restore the hashes or emit
data-cf-settingstags (microsoft/vscode#337226), on the grounds that re-authorizing content after delivery is exactly what the nonce mechanism exists to prevent, and that deferring JS has no upside when the application is JS. They named this Configuration Rule as the correct fix and the one they will document.Discussed in #8017; @code-asher confirmed a docs addition is the right move.
Change
One section under Expose code-server, placed after "TLS 1.3 and Safari" to match the existing pattern for environment-specific gotchas, plus the matching doctoc TOC entry.