fix(server): fall back to a passthrough when console.createTask is inert - #3233
Open
JamesbbBriz wants to merge 2 commits into
Open
fix(server): fall back to a passthrough when console.createTask is inert#3233JamesbbBriz wants to merge 2 commits into
JamesbbBriz wants to merge 2 commits into
Conversation
workerd's console exposes createTask but throws "not implemented" when it is called, while React's development builds call it at module initialization and during rendering (scheduler task tracing). The combination crashes every server environment on Workers: the RSC environment dies at module init and the SSR environment dies again during HTML rendering. installServerGlobals() — imported first by every generated server entry across environments — now probes the runtime implementation once and replaces it with a synchronous passthrough when it cannot execute. A working implementation (Node's task tracer) is left untouched, and runtimes without createTask are not modified.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
commit: |
Contributor
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
The intermediate `usable` flag and the inline task-shape cast duplicate what the catch branch already knows. Probe, and install on failure.
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.
workerd's console exposes
createTaskbut throws "not implemented" when it is called, while React's development builds call it at module initialization and during rendering (scheduler task tracing). The combination crashes every server environment on Workers: the RSC environment dies at module init and the SSR environment dies again during HTML rendering.installServerGlobals()— imported first by every generated server entry across environments — now probes the runtime implementation once and replaces it with a synchronous passthrough when it cannot execute. A working implementation (Node's task tracer) is left untouched, and runtimes withoutcreateTaskare not modified.Found while running a real Payload 3 app on vinext: the dev server 500s on every route until a manual stub is imported before the handler. This moves that workaround upstream.
Fixes #3234