worker_threads: defer worker-side stdio/Console setup to first access - #34345
Closed
robobun wants to merge 5 commits into
Closed
worker_threads: defer worker-side stdio/Console setup to first access#34345robobun wants to merge 5 commits into
robobun wants to merge 5 commits into
Claude / Claude Code Review
completed
Jul 16, 2026 in 18m 3s
Code review found 1 important issue
Found 1 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/js/node/worker_threads.ts:487-490 |
require('node:console').Console is undefined in workers after lazy console rebind |
Annotations
Check failure on line 490 in src/js/node/worker_threads.ts
claude / Claude Code Review
require('node:console').Console is undefined in workers after lazy console rebind
`require('node:console').Console` is now `undefined` inside workers: `node:console` is `export default globalThis.console`, and since it's no longer required at preload, its first evaluation triggers the lazy getter and caches a plain `new Console(...)` instance — which lacks `.Console`, `.write`, and `[Symbol.asyncIterator]`. Before this PR the preload's `require('node:console')` primed the module registry with the native console, so `const { Console } = require('console')` in a worker worked;
Loading