Skip to content

Fix /tables status diff viewer crash (React error #130) - #19109

Merged
Jackie-Jiang merged 1 commit into
apache:masterfrom
jadami10:jadami/oss-tables-status-diff-viewer
Jul 28, 2026
Merged

Fix /tables status diff viewer crash (React error #130)#19109
Jackie-Jiang merged 1 commit into
apache:masterfrom
jadami10:jadami/oss-tables-status-diff-viewer

Conversation

@jadami10

Copy link
Copy Markdown
Contributor

The Status diff modal for BAD/UPDATING tables renders <ReactDiffViewer/>. react-diff-viewer@3.1.1 is a Babel CJS module (__esModule=true, exports.default = DiffViewer), but the Vite build forced commonjsOptions.defaultIsModuleExports: true, making the default import resolve to the whole module.exports object instead of .default. Rendering that object as an element threw React error #130 ("got: object"). This only reproduced in the production build; dev worked because optimizeDeps pre-bundles the package via esbuild's __esModule-aware interop.

Set defaultIsModuleExports to 'auto' so the default import honors __esModule/exports.default, matching the esbuild interop used in dev. Plain-CJS default imports (no __esModule) are unaffected.

I relied on claude for this fix since I don't understand the vite build stuff well. But I tested it against our internal QA where opening the "diff viewer" for segment status was breaking, and this indeed fixed it. And generally navigating through the UI is unbroken.

The Status diff modal for BAD/UPDATING tables renders `<ReactDiffViewer/>`.
`react-diff-viewer@3.1.1` is a Babel CJS module (`__esModule=true`,
`exports.default = DiffViewer`), but the Vite build forced
`commonjsOptions.defaultIsModuleExports: true`, making the default import
resolve to the whole `module.exports` object instead of `.default`. Rendering
that object as an element threw React error apache#130 ("got: object"). This only
reproduced in the production build; dev worked because optimizeDeps pre-bundles
the package via esbuild's `__esModule`-aware interop.

Set `defaultIsModuleExports` to `'auto'` so the default import honors
`__esModule`/`exports.default`, matching the esbuild interop used in dev.
Plain-CJS default imports (no `__esModule`) are unaffected.
@Jackie-Jiang Jackie-Jiang added bug Something is not working as expected ui UI related issue labels Jul 28, 2026
@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.50%. Comparing base (a8b207e) to head (09bf7cf).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #19109   +/-   ##
=========================================
  Coverage     65.49%   65.50%           
  Complexity     1423     1423           
=========================================
  Files          3430     3430           
  Lines        218010   218010           
  Branches      34648    34648           
=========================================
+ Hits         142784   142803   +19     
+ Misses        63666    63648   -18     
+ Partials      11560    11559    -1     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-25 65.50% <ø> (+<0.01%) ⬆️
temurin 65.50% <ø> (+<0.01%) ⬆️
unittests 65.50% <ø> (+<0.01%) ⬆️
unittests1 56.87% <ø> (+<0.01%) ⬆️
unittests2 37.86% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Jackie-Jiang
Jackie-Jiang merged commit fc12594 into apache:master Jul 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working as expected ui UI related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants