strothj / react-app-rewire-typescript-babel-preset

Add TypeScript support to Create React App using @babel/preset-typescript
https://react-app-rewire-typescript-babel-preset.netlify.com
MIT License
52 stars 6 forks source link

Error in example project during npm start #12

Closed ianschmitz closed 6 years ago

ianschmitz commented 6 years ago

First of all, thanks so much for the package!

When following the usage instructions, or using the supplied example project, both result in the same error during npm start:

./src/index.tsx
Module build failed: Error: [BABEL] C:\Projects\tsexample\src\index.tsx:
.overrides is not allowed in preset options
    at Array.forEach (<anonymous>)
    at Array.map (<anonymous>)

This appears to be related to recent release of @babel/preset-typescript. More info can be read here: https://github.com/zeit/next.js/issues/4467#issuecomment-391883541.

Setting the dependency to be fixed to an older version does the trick:

"@babel/preset-typescript": "7.0.0-beta.46"

Just wanted to flag this in case other users run into the same issue.

strothj commented 6 years ago

Thank you for the report! I’ve reproduced it on my side.

Tomorrow I’ll see if there is anything that can be done from the prospective of the rewire.

strothj commented 6 years ago

I've pushed v2.2.1 that I think takes care of this. Let me know if you run into any trouble.