Fix cra frozen tsconfig#423
Merged
Merged
Conversation
Replaces window.confirm() with a MUI Dialog that requires the admin to type 'CONFIRM' before the schema migration can proceed, preventing accidental batch-writes to all apartment records.
patch-package: deep-copy readTsConfig in verifyTypeScriptSetup.js so appTsConfig stays mutable after immer freezes the original. Persisted via patch-package postinstall so the fix survives yarn install on Heroku. Also remove redundant 'import firebase from firebase/app' in ApartmentPage.tsx — only used for type annotations, and caused a firebase.User vs firebase.default.User mismatch across 23 other files that rely on the ambient namespace type.
Member
|
[diff-counting] Significant lines: 64. |
bryanshao07
approved these changes
Apr 17, 2026
bryanshao07
left a comment
There was a problem hiding this comment.
Looks good, solves two small issues, and makes it easier to run a migration.
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.
Summary
react-scripts@4.0.0viapatch-packageso Heroku builds don't crashimport firebase from 'firebase/app'inApartmentPage.tsxthat caused a TypeScript typemismatch across the codebase
Details:
verifyTypeScriptSetup.jsin CRA assignsappTsConfig = readTsConfig(same reference), then passesreadTsConfigthroughimmerwhich freezes it. Any subsequent write toappTsConfig.compilerOptionscrasheswith
TypeError: Cannot assign to read only property. Fix: deep-copy viaJSON.parse(JSON.stringify(...))beforeassigning.
node_modules(lost on every fresh install).patch-package+ apostinstallscript now re-applies it automatically after everyyarn install, including on Heroku.Test Plan
Deploy to
cuapts-staging— build should succeed without theTypeError: Cannot assign to read only property 'jsx'crash.Notes
react-scripts@4.0.0. If/when react-scripts is upgraded (Phase 3 dependencyupgrades), this patch file should be deleted —
patch-packagewill error loudly on install if the patch no longerapplies, making it easy to catch.
firebase/appimport removal inApartmentPage.tsx: the import was only used for thefirebase.Usertypeannotation. All other files in the codebase rely on the ambient Firebase namespace for this type — the explicit
default import created a
firebase.Uservsfirebase.default.Usersplit that TypeScript treated as incompatible.