You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtime: createRequire rejects node:-prefixed builtins / missing diagnostics_channel — pi wall #3 (require('node:diagnostics_channel') via bundle shim) #6644
Wall #3 of the pi coding-agent bring-up (tracker #6564; walls #1#6593 and #2#6604 fixed). With both fixes applied, the compiled pi binary gets through module init and dies at:
Error: Perry createRequire() currently supports built-in modules only; package/file require('node:diagnostics_channel') is not supported
Site: lru-cache's node build (pi bundle line ~5520) does require('node:diagnostics_channel') through the bundle's createRequire(import.meta.url) shim (the esbuild createRequire banner pattern — any ESM bundle of CJS deps produces this shape).
So perry's createRequire either (a) doesn't include diagnostics_channel in its builtin set, or (b) rejects the node:-prefixed form on this path while supporting the bare name. Both are worth fixing:
normalize node:-prefixed specifiers in createRequire before the builtin lookup (Node accepts both forms);
ensure diagnostics_channel is present as at least a functional stub (channel(), hasSubscribers, subscribe/unsubscribe, tracingChannel) — lru-cache only uses it for optional diagnostics, so a spec-shaped no-op channel suffices for this consumer, though a real implementation serves opentelemetry-adjacent code later.
Repro: HOME=$(mktemp -d) /Users/amlug/projects/perry/secret-tests/pi-target/dist/pi-native --help (binary built from the #6603+#6604 branches), or reduce to: an ESM file with const require = createRequire(import.meta.url); const dc = require('node:diagnostics_channel'); console.log(typeof dc.channel).
Activity
runtime: createRequire node:-prefix normalization + diagnostics_chann…
fix(codegen): globalize module-init lets nested in destructure Try sc…
runtime: unify createRequire builtin allowlist with getBuiltinModule …
runtime: unify createRequire builtin allowlist with getBuiltinModule …
fix(hir,codegen,runtime): closure-nested dynamic import() resolved; u…