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
raea run: console output and the default export's return value never reach the terminal (exit 0), so checkLayout checks always look clean #168
raea run SCRIPT.ts is documented as "what it prints is the answer", but nothing a program logs reaches the terminal: console.log, console.info, console.warn and console.error all vanish, the default export's return value isn't
printed, and the run exits 0. Reported by an agent through raea bug on raea 0.1.6 (macOS arm64); its workaround was
to smuggle the answer out in a spec's title.
It matters beyond the one report: the 3D guides tell agents to check a layout with raea run check.ts and fix every
error checkLayout prints (sdk/guides/craft/bevy/rooms.md, scenes.md, prompts.md). checkLayout returns its
findings, and a check script logs them, so every such check prints nothing and exits 0, which reads as a clean layout.
The thrown error's message is missing from its report too: only the stack's frames print.
Why
The console goes to Bevy's log, which raea run never sets up. The prelude routes console.* to __raea_log
(sdk/react/js/src/prelude.js), which runtime/react/src/thread.rs (fn log) hands to info!/warn!/error!. run_bundle (runtime/export/src/run.rs) builds its app from MinimalPlugins and the React plugin, with no LogPlugin, so no subscriber exists and every line is dropped.
Only the native print call reaches stdout (runtime/calls/src/lib.rs, "print", echoed while ECHO is
set). Nothing in a plain script calls it; the run's own entry uses it only for the error.
The return value is never looked at.bundle_script's entry (runtime/bundle/src/fresh.rs) calls and awaits
the default export, then sends done without printing what came back.
The error loses its message. The entry prints e.stack; on this engine a stack is only the frames
(fn@file:line:col), with no Error: message line first.
Fix
In bundle_script's entry, before the module runs, point console.log/info/debug at print (stdout) and warn/error at stderr, formatting values the way Node does: strings as they are, everything else through JSON.stringify (with a fallback for cycles) or its stack.
Print the default export's value when it isn't undefined: a string as it is, anything else as JSON.
Report a throw as String(e) followed by its stack, on stderr.
A test in the CLI's tests that runs the four scripts above and checks stdout, stderr and the exit code, plus a room
check that has an overlap and must print its error.
Activity