timarney / react-app-rewired

Override create-react-app webpack configs without ejecting
MIT License
9.77k stars 425 forks source link

babel-jest phantom dependency #585

Closed jeffknaide closed 2 years ago

jeffknaide commented 2 years ago

react-app-rewired directly uses babel-jest here: https://github.com/timarney/react-app-rewired/blob/master/scripts/utils/babelTransform.js#L1 but babel-jest is not included in dependencies or peerDependencies, which opens the possibility for react-app-rewired to reference an incompatible version of babel-jest (specifically ran into this issue when using pnpm package manager).

Recently, the babel-jest API around createTransformer has been broken (https://github.com/facebook/jest/issues/11444). As a result, installations of babel-jest 27.x break react-app-rewired.

Simply pinning babel-jest to <27 should resolve this issue.

emish89 commented 2 years ago

I created the fix to try to solve the problem with CRA5 https://github.com/timarney/react-app-rewired/pull/588