feat(notebook-app): route ErrorBoundary errors through host logger#2101
Merged
feat(notebook-app): route ErrorBoundary errors through host logger#2101
Conversation
componentDidCatch used to log via console.error only. In dev builds the
dev-mode attachConsole() pipes that to the terminal, but packaged / CI
builds swallow it entirely — which is why every E2E spec on 2026-04-23
shows "App not ready — toolbar not found" without any corresponding
error in app.log. The app is rendering the ErrorBoundary fallback
("Something went wrong") and we can't tell what threw.
Adds an opt-in module-scope sink in error-boundary.tsx. main.tsx wires
it to logger.error(...) so the React error and component stack land in
notebook.log alongside the rest of the app's output. Captured by CI as
e2e-logs/app.log, so the next failing run names the offender.
The sink is decoupled from NotebookHost because error-boundary.tsx
lives in /src/ (shared) and can't depend on app-level modules.
4 tasks
3 tasks
rgbkrk
added a commit
that referenced
this pull request
Apr 23, 2026
* docs(specs): streaming Arrow IPC for DataFrame repr (#1816) Design for dx emitting a Parquet head + a pull handle for incremental Arrow IPC continuation, so huge DataFrames render a first screenful immediately and grow in place. Key shape: - Head: 100-ish rows serialized as Parquet through the existing dx path. Sift's existing load hits immediately. - Continuation: new `nteract.dx.stream.<id>` comm. Runtime agent pulls Arrow IPC chunks outside the execution-message hot path and appends them as blob refs in a new manifest field on the same output id. - Transport is shared with #1815 (query backend). - No mutable blobs, no ContentRef shape change — chunks are a JSON list of existing blob refs inside the manifest. - Late joiners replay from the CRDT because chunks go through normal sync, not a side channel. * docs: update streaming Arrow IPC spec for runtime-doc crate changes - RuntimeStateDoc moved from notebook-doc to runtime-doc (#2056) - CRDT writes go through RuntimeStateHandle (#2059) - Pull task uses fork()/merge() for async blob work - Dead broadcasts removed (#2065) - manifest updates propagate via CRDT - Updated review pointers to current file paths * docs: fix reserved-comm-namespace pointers in streaming Arrow IPC spec The namespace rule moved out of CLAUDE.md and now lives in .claude/rules/architecture.md § "Reserved Comm Namespace: `nteract.dx.*`". Update the two spec references to point there. No change to the design itself. * feat(runtimed-wasm): install console_error_panic_hook on module init Rust panics inside WASM currently surface to the frontend as an opaque `__wbg___wbindgen_throw_6b64449b9b9ed33c` stack with wasm-function indices and no file/line. The error reaches the App ErrorBoundary and the "Something went wrong" fallback renders, but the cause is invisible in packaged / CI builds. This is exactly what's happening on UV Pyproject + UV Prewarmed E2E today (post-#2103): something in the runtime-doc read path panics when the daemon syncs a RuntimeState that walks through the full lifecycle starting → running, and we have no way to name it. Install `console_error_panic_hook::set_once()` from a `#[wasm_bindgen(start)]` function so it runs exactly once before any `NotebookHandle` is constructed. Panics now log with file, line, message, and a Rust backtrace. Combined with #2101 (ErrorBoundary → host logger), the next failing E2E run will emit both the React component stack and the Rust panic payload into `e2e-logs/app.log`. Rebuilds the WASM bundle to pick up the hook wiring. Verification: - `cargo xtask wasm runtimed` — succeeds - `deno test --allow-read crates/runtimed-wasm/tests/` — shape test still passes (51 filtered + 1 ok, the expected set) * feat(notebook-app): forward console.error to host logger The wasm panic hook from the previous commit calls `console.error`. In dev builds `attachConsole()` from tauri-plugin-log is DEV-only (see packages/notebook-host/src/tauri/index.ts:280), and the plugin only bridges Rust log output INTO the browser console — it doesn't forward browser console OUT to Rust. In packaged / CI builds the panic message goes to `console.error` and stops there. Install a small forwarder in main.tsx: wrap `console.error` to also call `logger.error` (host-log). WASM panics now land in notebook.log alongside everything else, visible in CI's `e2e-logs/app.log`. Preserves the original console.error behavior so devtools stays unchanged. The forwarding call is in a try/catch so a logger failure can't swallow the original error.
4 tasks
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.
Summary
ErrorBoundary.componentDidCatchgains an opt-in module-scope sink;main.tsxwires it tologger.error(...)so caught render errors and their component stacks land innotebook.log.console.error. In packaged / CI builds that goes nowhere — which is why every E2E spec on 2026-04-23 failed with "App not ready — toolbar not found within 15s" butapp.logshowed nothing interesting.Motivation
While investigating why E2E is broken on
maintoday, I pulled the failure screenshots from run 24839322000. Every one shows the ErrorBoundary fallback — "Something went wrong. The notebook encountered an unexpected error." — rendered before the tests ever find the toolbar. The logs around it look healthy:That "Cleanup" sequence is the boundary unmounting the thrown subtree. The actual error is invisible. This PR fixes that observability gap.
Approach
error-boundary.tsxlives in/src/(shared code, no NotebookHost dependency), so I added a module-scopesetErrorBoundarySink()setter rather than coupling the component to@nteract/notebook-host.main.tsxinstalls the sink right aftersetLoggerHost(host)— same pattern as the other boot-time setters. The sink is wrapped intry { } catch {}so a broken logger can never hide the original error.Test plan
cargo xtask lint --fixpasses[ErrorBoundary] render error:line ine2e-logs/app.logDoes not fix the underlying render error — that's a follow-up PR once we know what's actually throwing. This is purely observability.