boardgameio / boardgame.io

State Management and Multiplayer Networking for Turn-Based Games
https://boardgame.io
MIT License
10.04k stars 709 forks source link

create-react-app build fails because of async/await #221

Closed darekkay closed 6 years ago

darekkay commented 6 years ago

I've created a create-react-app project (as suggested in your docs) and added boardgame.io. In dev mode ( npm run start), everything works fine. However, a production build (npm run build) fails to minify. The error message points to boardgame.io/dist/react.js line 841, so it's probably async/await causing the problems. I've removed the simulate function (it's not really needed in production, as it is part of the debug module) and the build run successfully.

My environment:

nicolodavis commented 6 years ago

Yeah, we should probably strip out debug.js entirely for prod builds. Thanks for the report!

nicolodavis commented 6 years ago

Fixed in 0.23.3.

darekkay commented 6 years ago

Thanks for fixing this so quickly! 😄

jrow2286 commented 5 years ago

I'm having the same issue in 0.28.1. Line 1770 of boardgame.io/dist/react.js

nicolodavis commented 5 years ago

What version of create-react-app are you using?

jrow2286 commented 5 years ago

2.1.8

nicolodavis commented 5 years ago

Can you try upgrading to 0.31.4 (the latest version of boardgame.io)? I also added an integration test that verifies that CRA can build, so it should definitely work for the versions after 0.30.

jrow2286 commented 5 years ago

Thanks for the help and quick response!