Skip to content

fix: render runtime stack frames as text - #1058

Open
OskarEichler wants to merge 1 commit into
pmmmwh:mainfrom
OskarEichler:codex/react-refresh-stack-text
Open

fix: render runtime stack frames as text#1058
OskarEichler wants to merge 1 commit into
pmmmwh:mainfrom
OskarEichler:codex/react-refresh-stack-text

Conversation

@OskarEichler

Copy link
Copy Markdown

Fix

Render parsed runtime stack function names and filenames as text rather than assigning them to innerHTML.

Stack frame values can contain markup-like characters. The runtime overlay currently turns those values into live DOM elements, which both corrupts the displayed trace and allows markup attributes to become active inside the development overlay.

Implementation

Use textContent for fallback text, function names, and filenames. Unicode em spaces preserve the indentation previously produced by   entities.

Verification

  • Added a real parsed-stack regression containing markup in both the function name and filename. It fails on current main by creating img and strong elements, and passes with the values preserved as literal text.
  • Full suite including headless Chrome HMR conformance: 123 tests across 15 suites, 26 snapshots passed.
  • ESLint, Prettier, TypeScript, and whitespace checks passed.
  • React Doctor: 100/100.

Compatibility / breaking changes

No public API, dependency, socket integration, or supported-platform changes. Runtime stack values display literally instead of being interpreted as HTML.

@codesandbox

codesandbox Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

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.

1 participant