fix(FR-2606): replace global.packageVersion with globalThis.packageVersion in WebUISider#6878
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 30, 2026
Conversation
This was referenced Apr 22, 2026
This was referenced Apr 22, 2026
Contributor
Author
This was referenced Apr 22, 2026
ef57101 to
78236e1
Compare
ac2e78d to
4afa90d
Compare
This was referenced Apr 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Vite-only runtime crash in the sidebar footer by reading injected build metadata from globalThis instead of global, aligning with how the values are written in index.html.
Changes:
- Replace
global.packageVersionwithglobalThis.packageVersioninWebUISiderto avoidReferenceError: global is not definedunder Vite.
78236e1 to
b789f9e
Compare
16f63fd to
47b0844
Compare
3aa344c to
9750f0b
Compare
47b0844 to
71a5bf7
Compare
71a5bf7 to
fa7e95d
Compare
9750f0b to
4b6a570
Compare
fa7e95d to
5f1405f
Compare
4b6a570 to
0bd7009
Compare
5f1405f to
cdc4e8a
Compare
This was referenced Apr 30, 2026
Merge activity
|
…eVersion` in WebUISider (#6878) Resolves #6809(FR-2606) ## Summary Runtime error found after logging into the app with the Vite build: ``` ReferenceError: global is not defined at WebUISider (WebUISider.tsx:349:21) ``` Triggered the error boundary, blanked the sidebar footer area. **One-line fix.** **Root cause**: `WebUISider.tsx:349` read `global.packageVersion`. Under CRA/Webpack, `global` was auto-aliased to `window` in browser builds, so the reference worked by coincidence. Vite intentionally leaves `global` undefined in the browser (`nodePolyfills({ globals: { global: false } })` in `vite.config.ts`), so the same reference now throws. The value is actually written to `globalThis.packageVersion` in the root `index.html` inline script — switching the read site to `globalThis` matches the writer and works under any bundler. ## Verification - [x] `grep -r 'global\.' react/src` → only test-file usages remain (where `global === globalThis` in node/jsdom env) - [x] Started dev server, logged in as admin, confirmed sidebar renders `26.4.0-alpha.0.<buildNumber>` with no `ReferenceError` in console - [x] Error boundary no longer activates on the start page ## Stack Logically belongs to FR-2606 (Vite parity work). Sits above the PWA manifest fix.
7253345 to
7b13055
Compare
cdc4e8a to
6683df9
Compare
Base automatically changed from
04-21-fix_fr-2608_disable_vite-plugin-pwa_auto-manifest_to_preserve_existing_manifest.json
to
main
April 30, 2026 12:32
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.

Resolves #6809(FR-2606)
Summary
Runtime error found after logging into the app with the Vite build:
Triggered the error boundary, blanked the sidebar footer area. One-line fix.
Root cause:
WebUISider.tsx:349readglobal.packageVersion. Under CRA/Webpack,globalwas auto-aliased towindowin browser builds, so the reference worked by coincidence. Vite intentionally leavesglobalundefined in the browser (nodePolyfills({ globals: { global: false } })invite.config.ts), so the same reference now throws.The value is actually written to
globalThis.packageVersionin the rootindex.htmlinline script — switching the read site toglobalThismatches the writer and works under any bundler.Verification
grep -r 'global\.' react/src→ only test-file usages remain (whereglobal === globalThisin node/jsdom env)26.4.0-alpha.0.<buildNumber>with noReferenceErrorin consoleStack
Logically belongs to FR-2606 (Vite parity work). Sits above the PWA manifest fix.