boardgameio / boardgame.io

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

Looking for mongodb and firebase despite not being configured to use #249

Closed jorbascrumps closed 6 years ago

jorbascrumps commented 6 years ago

Looks like an issue may have been introduced with v0.25.0 where the framework tries to access mongodb and firebase even if no persistent storage method is configured.

nicolodavis commented 6 years ago

What do you mean by looking for / access?

nicolodavis commented 6 years ago

Does running npm run dev on the boardgame.io repo demonstrate this problem as well?

jorbascrumps commented 6 years ago

Sorry, I should have provided more detail. I'm running a server in a multiplayer environment, all local. When I start said server the application throws with an error saying it can't find mongodb and firebase. If I manually install these dependencies everything works correctly.

Running npm run dev doesn't seem to repro this issue. My assumption is because these were marked as dev dependencies in the latest release and aren't included when installed in a project.

nicolodavis commented 6 years ago

Got it. I think these require statements should become conditional by going into the constructors of the Mongo and Firebase classes, so that they're executed only when their respective classes are used. My bad.

jorbascrumps commented 6 years ago

All good! Thanks for all your hard work.

nicolodavis commented 6 years ago

Fixed in 0.25.1.

jorbascrumps commented 6 years ago

Tested and confirmed working. Thanks again!