Skip to content

fix(deps): bump @microlink/react-json-view to fix invalid element type crash - #1355

Merged
BYK merged 1 commit into
getsentry:mainfrom
rvanvelzen:fix/react-json-view-esm-interop
Sep 15, 2026
Merged

BYK merged 1 commit into
getsentry:mainfrom
rvanvelzen:fix/react-json-view-esm-interop

Conversation

@rvanvelzen

Copy link
Copy Markdown
Contributor

Summary

  • JsonViewer (used by trace/event context views, span DB query descriptions, envelope details, logs) can crash the whole app with React error meta(changelog): Update package versions #130 ("Element type is invalid... but got: object").
  • Root cause: @microlink/react-json-view@1.23.x's CJS/UMD bundle ends up double-wrapped as { default: Component } under Vite's dependency interop (both vite build and the dev server's esbuild pre-bundling), so the default import resolves to an object instead of the component.
  • The package fixed this themselves in 1.31.9 by adding a proper index.mjs ESM entry point and a conditional exports map (getsentry/spotlight is unaffected by this class of interop bug once resolving to that entry). This PR just bumps the dependency to pick up their fix; no application code changes needed.

Test plan

  • Reproduced the crash live against real trace data using the previous pinned version (1.23.4 range, resolved 1.26.1) in both vite --config vite.dev.config.ts and the production vite build --config vite.ui.config.ts bundle.
  • After the bump (resolves to 1.31.34), rebuilt the production bundle and loaded 10+ real trace/context views (including large nested payloads) with no error meta(changelog): Update package versions #130 and no console errors from JsonViewer.
  • tsc --noEmit clean for the affected files; existing AnsiText unit tests in the same directory still pass.

…e crash

Vite's CJS interop for the old 1.23.x bundle resolves the default import
to `{ default: Component }` instead of the component itself, throwing
"Element type is invalid" (React error getsentry#130) wherever JsonViewer renders.
Fixed upstream in 1.31.9 via a proper ESM entry point and exports map.
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
spotlightjs Skipped Skipped Sep 15, 2026 2:04pm UTC

Request Review

@BYK

BYK commented Sep 15, 2026

Copy link
Copy Markdown
Member

Thanks a lot!

@BYK
BYK enabled auto-merge (squash) September 15, 2026 15:40
@BYK
BYK merged commit 3dd5eb5 into getsentry:main Sep 15, 2026
19 checks passed
@rvanvelzen
rvanvelzen deleted the fix/react-json-view-esm-interop branch September 15, 2026 15:59
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.

2 participants