Skip to content

Conversation

@n3tr
Copy link
Contributor

@n3tr n3tr commented Oct 27, 2020

Verify steps

  • yarn create-react-app my-app --template typescript
  • cd my-app
  • yarn add [email protected]
  • yarn start

@n3tr
Copy link
Contributor Author

n3tr commented Oct 27, 2020

There is another issue here -- By default, if parsedValue is undefined we will try to use value instead

const valueToCheck = parsedValue === undefined ? value : parsedValue;

but seems like immer() make the object frozen which will cause line

appTsConfig.compilerOptions[option] = value;

to throw an error

/Users/jirat.ki/Code/lab/cra-ts/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js:242
      appTsConfig.compilerOptions[option] = value;
                                          ^

TypeError: Cannot assign to read only property 'jsx' of object '#<Object>'

I debugged and found

console.log('Object.isFrozen(appTsConfig.compilerOptions)', Object.isFrozen(appTsConfig.compilerOptions))
// Object.isFrozen(appTsConfig.compilerOptions) true

@n3tr
Copy link
Contributor Author

n3tr commented Oct 27, 2020

Closed, duplicated #9921 and #9869

@n3tr n3tr closed this Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants