React Typescript: Line 0: Parsing error: Cannot read property 'name' of undefined
The problem apparently was caused by a misconfiguration of some (peer?) dependencies of a dependency, react-scripts
with the TypeScript template. It went away. Make sure you update your dependencies, purge node_modules
, even purge package-lock.json
or yarn.lock
, and try a fresh build again now.
I case of an app generated by
npx create-react-app my-app --template typescript
More precisely, [email protected]
The issue was solved by running the following command:
rm yarn-lock && rm -rf node_modules && npm i
After which you may run:
either yarn start
or npm start
Just update typescript version to 3.8.x : Link