-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot assign to read only property 'jsx' of object '#<Object>' #10110
Comments
I have this happening after upgrading to typescript 4.1 |
Duplicate with #9868 |
Same issue I am facing. Just ran the |
+1 |
Duplicate of #9868 |
Definitely, a Duplicate of #9868 but also can confirm getting the following error: -
|
+1 seeing this as well |
+1 Now i can't create new typescript anymore !!! |
You can fix this issue for the time being by downgrading to Typescript 4.0.5. It is an issue with Typescript 4.1+ being present with CRA 4.0 and may be fixed once CRA 4.0.1 is released. |
I've just had this exact error, the problem is in Thanks to @benneq this is fixed in the master branch (already three weeks ago), just needs a new patch version (see the fix: #9869). |
I tried that. Downgraded to TS 4.0.5 and replace "react-jsx" with "react" in the tsconfig.json |
please solve this . i have this error too. |
Personally, I was able to fix this issue (this is on a fresh project) by: |
I just deleted tsconfig.json and ran yarn start, and it recreates it and runs (I did update to ts 4.0.5 too). But you have to delete everytime you run yarn start. i.e rm tsconfig.json && yarn start Hacky until we get a fix. |
It works and the generated file is actually identical |
For anyone also seeing this error.. it is already known, and a fix has been merged to master. What we are waiting for now is a React-Scripts v4.0.1 patch on npm... no word yet on when that's happening. The fix I am referencing: #9869 |
Yooo. Thanks |
You could also comment out the line 239 in verifyTypeScriptSetup.js |
This is not a solution in any kind of production environment that uses a VCS that ignores the node_modules directory. |
Solution Change typescript version in package.json Change in tsconfig.json In the terminal
|
A quick solution as mentioned above 👍
|
Workaround for those who want to use TypeScript 4.1 and create-react-app 4.0.0: set the environment variable Also, The
|
I solve this issue "react-scripts": "4.0.0-next.98"
"typescript": "^4.1.2",
|
* Use same version of SC as in rLogin. * ignore windows debug.log file. * revert jsx setting caused by build. * Set fixed version of typescript, ref: facebook/create-react-app#10110.
The following occurred on `yarn start`: TypeError: Cannot assign to read only property 'jsx' of object '#<Object>' See: facebook/create-react-app#10110 (comment)
I see this issue with my version of TypeScript at |
It seems like its fixed now with TS 4.0.3 as well |
Ran into this issue as well on |
Just One thing: |
update cra to 4.0.1 or set ts version to like "~4.0.5" |
Worked for me. Jan 28th 2020 for existing create-react-app app from 3 months ago. I tried just changing react-jsx to react but that was not enough. YOu have to change the version too and npm install Make sure you use ~4.0.5 and not ^4.0.5 as only the former works! |
TypeError: Cannot assign to read only property 'jsx' of object '#<Object>' facebook/create-react-app#10110
I solved this issue by upgrading yarn upgrade react-scripts@latest |
* Data vault view insert (#14) * Create authenticated component/container to hold the header and navigtation. - will handle navigation next. * Create navigation with useState() - Using useState() instead of routes right now becuase it is only two pages. Keeping it simple - Empty DataVault component/container that will be populated next. - Add test for navigation file * Create Add Declarative Details UI, update scss and add icons. * Add DeclarativeDetails display and update styles on Add. * Move navigation and header into the authenticated folder. - These are not reusable components but specific to the id manager. * Fix broken test by wrapping it in act(). * Fix broken test by wrapping it in act(). * Add DataVault pinner service - Save pinner client into context - Create reducer to hold DV content, and connect it to components - Create config endpoint for DV * Connect "Add New" component to datavault - Create create operations to connect DV - Ad loading component and update button and input styles when loading. * Fix test and create defaultstate for context. * Move DV config to JSON files and handle null - Save if it has DataVault in redux. Will be used in multiple places soon - Do not show navigation tab for datavault if none for network - Remove test that will always fail * Remove hasDataVault from redux - get the vault from context in the authenticated component and pass down to navigation. * Implement ipfs-cpinner-client...beta2 version - Save item in redux using its key - Content is saved with its id to be used as the <tr> key and will be used for delete/update - Update frontend and tests to reflect the changes * Create pr.yml (#15) * Data vault delete (#17) * Add delete functionality. * Improve user experience when deleting - Create modal to handle yes/no confirmations - Implement this modal when the user clicks 'delete' - Add trash icon and CSS for buttons * Move context out of AddComponent and to DataVaultComponent - Moving the reference to context to the container/component. This will allow this component to be more independent. - Matches the implementation from "delete" * use correct function when deleting. * Add .disabled option to list items. * Fix pr.yml (#16) * Fix pr.yml * Update package.json * Fix CSS on Build (#18) * Use same version of SC as in rLogin. * ignore windows debug.log file. * revert jsx setting caused by build. * Set fixed version of typescript, ref: facebook/create-react-app#10110. * Data vault swap (#19) * Create EditValueModal to handle editing of content - Handles single & multiline with custom inputs and event handlers - Additionally, add classNames to modal for better testing 'finds' - Can replace modal in EthrDid sections * Implement swap content by id/key. - Use EditValue modal to handle visuals - Add operations to interact with DV - Update value in redux on success * Update tests - Fix existing (delete) test that now found two buttons - Write test for upgrade state changes - Add missing reducer tests for types/payloads * DataVault Summary Panel with max storage (#22) * Build DataVault Summary Panel on Dashboard - Show MaxStorage, button to DataVault screen - New component: progress bar that takes total and value * Implement getStorageInformation operation and redux value - Static storage until beta3 is published * Use beta3 version of the ipfs pinner - Implement size operation - Show sizes on hover as bytes - Progress bar will show at least 1% if the value is more than 0 but less than 1%. This is visual for the user to at least see a value * final cleanup. * Manage Identity Screen (#31) * Create empty container/component for Identity screen. * Move Identity owner and delegate to new screen. * Refactor Owner component on Identity Screen - Elevate context to component/container level - Use EditValue Modal to simplify code - Remove unused formatter in favor of formatAddressDid() * Refactor Delegates - Use EditValueModal and pass value up to container/component which handles connection to context. - Show PublicKey not Authentication to get the delegate address * Move edit buttons to panel header row. * Add Service Endpoint component. - Format <ul> inside of panels * Add PublicKeys Component and interaction, add TransactionListener - Use exsiting "addAttribute" function - Add transactionListener to watch the transactions - Update addAttribute to use new listner - SCSS changes to make it classy - Add inputDefaults and return int * Implement transaction listener on all ethr-did calls. * Hide adding attributes if the user is not the owner. * Add icons and cleanup console logs and comments. * Requested Changes - Replace secp256ka with secp256k1 - Update button title to "Add Public Key" * Edit persona, multiple fields, and avatar (#29) * Remove 'includeEthr' parameter from createDidFormat - DIDs should always include :ethr: * Add icon and get DD_NAME from datavault (if exists) to display in header. - Style and center profile icon - Display only * Create Edit Persona Modal and pass down Persona Declarative Details. * Connect editing persona UX to helper function that updates/inserts/deletes the content. * Refactor to make it easier to add fields for Persona. - Use shallow on header tests so we don't have to update test when adding field * Add missing fields. * Remove catch from getStorage. * Requested Changes - Remove catch statement on getStorageInfo - No hover state if there is a name in the header. * Fix issue created by rebase. * Add Copy button to dashboard persona information (#34) - Don't render the persona info panel until chainId and address are saved - pass address & chainId instead of DID to panel - Add copy button to DID and Address * Defi Assets Screen and Get USD balance (#33) * Create new screen for DeFi Assets and move Balance component to that screen. * STASH * Rename `tokens` to `defi` - defi is expanding and not all the data will be tokens. i.e. gas - Reducer & operations updated and their connections. * Create DeFi Summary panel on Dashboard - Get balance from wallet and prefix it with its name - Pull in featured token if name is RIF or tRIF - Create component 'BalanceRow' to format the balances * Update defi screen to use BalanceRow and new [add] button. * Fix navigation classNames. * Fix issues caused by assumed and rebase. * Add USD conversion to balanceRow. * Get conversion rates from CoinGecko - Use the RSKSmart list of contracts to pull in tokens for RSK networks - In config, create coinGecko ID list to pull in values once - Map conversion values to defaultBalance, or to a contract name (RIF) * Final cleanup - Pass RIF balance to summary panel - Update Tooltip inheritance * Save token (from RSK list) to storage if it has a balance. * Display Verifiable Credentials (#35) * Rename data to declarativeDetails in reducer. * Add credentials to reducer and update receiveKeyData to handle keys with 'credential' in them. * Create panel for Credentials - Pass credentials into panel - CredentialView component to handle displaying the credential, add button to view raw and handle non-JWTs. * Prefix user's declarative details with DD_ and convert key to uppercase. * Update DataVault to use Encryption (#39) * Update DataVault to use Encryption - Use latest package of pinner service - Works on all networks, not just RSK Testnet This fixes the following issues: - Fixed #32 - Broken connections to the datavault are thrown and the client is not saved into context. - Fixed #30 - DataVault now only requests auth token once with the init getStorageInfo() command. - Fixed #23 - DataVault works on Ethereum and RSK Mainnet * Missed linebreak and package update. * Use v0 dv endpoint. * Allow user to Download contents from DataVault - Panel at the bottom of the DV screen for downloading - Component to handle UX - Operations function that calls the download function, creates text file and downloads it to the user * Delete credential from the Data Vault (#41) * Extract DeleteButton into its own component - Migrate test to check functionality, - Pass handleDelete up the tree to container * Add error to Binary Modal. * Allow user to delete a credential - Add `options` props in credentialViewer, - Pass delete button and connect to existing reducer - Remove item from the credential key * Final Cleanup. * Implement Lazy loading of content inside of keys (#40) * Add Lazy Loading - At the init of the app, only the keys are downloaded - Button to download and decrypt data on each row * Refactor DecryptKey Button into its own file - Connect to existing DD table - Add download button to Credential table * Update DD Display test and add additional for getContent. * Delete the key if the user deletes all the content from it. * Hide/Show message to download if keys have no content * Added MIT license and ignore .env (#45) * Create Verifiable Presentations from Credentials stored in the DataVault (#46) * POC of Verifiable Credential - Create proof of concept with static DID and Address to see if it works. * Refactor to pull credential part out and use ENUM for status. * Pass presentation up the chain and create tests. * Handle connections to DV where encryption is not possible (#44) * Fix error with sign where address and data are swapped. - Resolves an issue with WalletConnect where it couldn't authenticate with the datavault. * Use real encryptionManager if Metamask, but dummy for Nifty - Pass dummy encryption function for Nifty and WalletConnect - Add function to get provider name from the provider. FYI: Nifty return true to isMetaMask, so it check isNifty first. * Show static alert if wallet is not Metamask - Metamask is encrypted * Quick Fixes - Use correct prefix for Ethereum - Use lowercase DID with Datavault. Resolves an issue where metamask and Trust wallet return different checksums for the address. * Bump DV client to 8. * Throw and Handle Error Throw and handle an error if the user's wallet is unable to decrypt encrypted content from the DV. Edge case when user inserts data using Metamask and retrieves it via nifty or walletConnect. * Extract message and refactor to use in Credential section. * Bump DataVault client and endpoint (#49) * Bump pinner client to 9. * Update datavault endpoint to /v2 * Return correct provider constant and allow valut to be optional. * Add logout button (#54) * Add reset option to each reducer and test. * Add code to reset app on Logout - Centralized logout function - Connect to each reset() function in reducers - Clear localStorage. This will be moved to rLogin in the future * Add visual logout button and connect it to context.reset() and the operations logout file. * Add Ethereum Testnets (#53) * Add Ropsten testnet. * Add Koven testnet. * Add Rinkeby testnet. * Add Goerli * reduce duplicate code. * Update names for testnet gas. * Final clean up. * Change <Button to <button in the DV summary. (#51) - Update text * Fix Debug Logs exposed in the Browser (#55) * Fix Debug Logs exposed in the Browser From security audit RLOGIN-006 * Lint * Cache the web3 provider (#56) * Bump rLogin and move services into dep. * Implement auto-login based on cached value - check if cached value exists, rLogin will use it automatically * Move resetting context to the operations file. * Remove passing cachedProvider as it is not needed. * Add eip1193 listners to the AuthenticatedComponent - Since these listeners change the Context, they need to be inside of a React Component. Placing them in the operations file resulted in creating unwanted copies. * Add warning message to DV component and refacor the &&. * Combine functions and pass to container to make decision. * cleanup. * Explicitly set styled-components and add resolution to make sure they remain the same. - rLogin, or web3Modal's version of styled components was different than the Id Manager. This caused rendering issues. The resolution idea was from the issue raised below. Ref: styled-components/styled-components#1941 * Use the did-jwt version from RSK to sign the presentations. (#50) * Use the did-jwt version from RSK to sign the presentations. * Use link to verifier instead of textarea with DID. * Fix data vault endpoint (#60) * Update encryption methods (#61) * bump package version. * Update create client to use new encryption options. * Remove warning that the wallet is not secure. * Update test props and remove test for for the warning. * use AsymmetricEncryptionManager for metamask Update src/app/state/operations/datavault.ts Co-authored-by: Ilan <36084092+ilanolkies@users.noreply.github.com> Co-authored-by: Ilan <36084092+ilanolkies@users.noreply.github.com> * Add continuous delivery (#63) * Fix encryption with WC (#62) * Update datavault endpoint (#64) * Update datavault endpoint. * Add homepage backend using "." so it will support relative paths Reference: https://create-react-app.dev/docs/deployment/#serving-the-same-build-from-different-paths * Refactor encryption for Metamask, fix how it is created. * Continuous Delivery added (#65) Co-authored-by: Jesse Clark <hello@developerjesse.com> Co-authored-by: Javier Esses <javiesses@hotmail.com> Co-authored-by: juan-rsk <57964683+juan-rsk@users.noreply.github.com>
For me changing "react-scripts" version in package.json from "4.0.0" to "4.0.1" and running |
This solved it for me. thanks |
Downgraded typescript due to an issue with Typescript 4.1+ being present with CRA 4.0 . For more information, check this page facebook/create-react-app#10110
I solve this error updating react-scripts to 4.0.3
|
even after fix i still was getting this issue and the root cause was that my |
|
删除 tsconfig.json 文件,重新运行 npm start 项目能临时起来 |
Describe the bug
When creating a react-typescript app using
npx create-react-app . --template typescript
The error:
The text was updated successfully, but these errors were encountered: