Skip to content

fix(server): fall back to a passthrough when console.createTask is inert - #3233

Open
JamesbbBriz wants to merge 2 commits into
cloudflare:mainfrom
JamesbbBriz:fix/console-create-task-fallback
Open

fix(server): fall back to a passthrough when console.createTask is inert#3233
JamesbbBriz wants to merge 2 commits into
cloudflare:mainfrom
JamesbbBriz:fix/console-create-task-fallback

Conversation

@JamesbbBriz

@JamesbbBriz JamesbbBriz commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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.

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

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@3233
npm i https://pkg.pr.new/create-vinext-app@3233
npm i https://pkg.pr.new/@vinext/types@3233
npm i https://pkg.pr.new/vinext@3233

commit: ae4c20a

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared ae4c20a against base 13e7d9c using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.4 KB 142.4 KB ⚫ -0.0%
Client entry size (gzip) vinext 129.7 KB 129.7 KB ⚫ -0.0%
Dev server cold start vinext 3.26 s 3.26 s ⚫ -0.1%
Production build time vinext 3.38 s 3.42 s ⚫ +1.1%
RSC entry closure size (gzip) vinext 125.4 KB 125.5 KB ⚫ +0.1%
Server bundle size (gzip) vinext 216.1 KB 216.3 KB ⚫ +0.1%

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev server crashes on Workers: console.createTask exists but throws; React dev builds call it in every environment

1 participant