Skip to content
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>' #10117

Closed
neonise opened this issue Nov 20, 2020 · 12 comments
Closed

Comments

@neonise
Copy link

neonise commented Nov 20, 2020

when i want to use typescript template then npm start get this error.
i know this is duplicate .
but i think this error is important to solve.

@ragnarok1998
Copy link

Screenshot from 2020-11-20 20-42-58

@ragnarok1998
Copy link

reference
#9868

@neonise
Copy link
Author

neonise commented Nov 20, 2020

i have the error yet.
no affected

@FelHa
Copy link

FelHa commented Nov 20, 2020

I'm getting the same error. After installing unmet peer dependencies and changing the tsconfig.json the errors are gone. See:
https://stackoverflow.com/questions/64932747/yarn-create-react-app-with-typescript-throwing-errors

@HashemKhalifa
Copy link

HashemKhalifa commented Nov 20, 2020

I have the same issue, you can override it by removing the tsconfig.json and run yarn start will populate a new tsconfig.json and will work!
P.S you can't modify the tsconfig.json file!

there's a solution for this #9868 (comment)

@jjavierdguezas
Copy link

I have the same issue, you can override it by removing the tsconfig.json and run yarn start will populate a new tsconfig.json and will work!
P.S you can't modify the tsconfig.json file!

this work, thanks

@neonise
Copy link
Author

neonise commented Nov 21, 2020

'cp' is not recognized as an internal or external command

@neonise
Copy link
Author

neonise commented Nov 21, 2020

'yarn' is not recognized as an internal or external command

@ghost
Copy link

ghost commented Nov 22, 2020

I have the same issue, you can override it by removing the tsconfig.json and run yarn start will populate a new tsconfig.json and will work!
P.S you can't modify the tsconfig.json file!

there's a solution for this #9868 (comment)

This is only works once. If you stop the server and restart it throws the same error. Seems to be an issue with Typescript itself or the way CRA handles the tsconfig file, not sure. I did a rollback to v4.0.5 and changed the jsx option to react and it works fine.

package.json

+"typescript": "^4.0.5",
-"typescript": "^4.1.2",

tsconfig.json

+"jsx": "react"
-"jsx": "react-jsx"

@ghost
Copy link

ghost commented Nov 23, 2020

Can be closed. Fixed in in release react-scripts@4.0.1

@neonise
Copy link
Author

neonise commented Nov 23, 2020

i am confused.
what should i do now to fix?
should i run create-react-app again?

@jonathaningersoll
Copy link

I had this issue until I

  1. updated my react-scripts to 4.0.1
  2. updated my typescript version to 4.1.2
  3. updated my package.json to reflect the changes
  4. ran npm start - no errors.

After updating, I didn't even have to re-generate my tsconfig.json

@neonise neonise closed this as completed Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants