jefflau / jest-fetch-mock

Jest mock for fetch
MIT License
886 stars 118 forks source link

Build fails on create-react-app #59

Closed hammadfauz closed 6 years ago

hammadfauz commented 6 years ago

yarn build fails with the following output:

Failed to minify the code from this file:

        ./node_modules/jest-fetch-mock/src/index.js:11

Read more here: http://bit.ly/2tRViJ9
jefflau commented 6 years ago

I'm not a yarn user so I'm not sure what the issue is exactly

jefflau commented 6 years ago

Ah, it could be the fact that this package uses ES6 by default and create react app might assume it's ES5. But you probably shouldn't be building this package in production since it's just a mocking library. Maybe you can move your jest-fetch-mock dependency to dev dependencies and then CRA won't build it?

hammadfauz commented 6 years ago

I agree that it shouldn't build in prod. I moved it to dev dependencies, but CRA still seems to be building it. Guess I'll open an issue there then. Thanks!

jefflau commented 6 years ago

I'm closing this issue. Let me know if it's still a problem