Fix /tables status diff viewer crash (React error #130) - #19109
Merged
Jackie-Jiang merged 1 commit intoJul 28, 2026
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jackie-Jiang
approved these changes
Jul 28, 2026
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.
The Status diff modal for BAD/UPDATING tables renders
<ReactDiffViewer/>.react-diff-viewer@3.1.1is a Babel CJS module (__esModule=true,exports.default = DiffViewer), but the Vite build forcedcommonjsOptions.defaultIsModuleExports: true, making the default import resolve to the wholemodule.exportsobject 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
defaultIsModuleExportsto'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.