firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Painfully slow emulator start if no network is available

Open stfsy opened this issue 2 years ago • 1 comments

[REQUIRED] Environment info

firebase-tools: 11.9.0

Platform: Windows

[REQUIRED] Test case

Disable WIFI / unplug ethernet and start the emulator.

[REQUIRED] Steps to reproduce

Disable WIFI / unplug ethernet and start the emulator. You'll notice the emulator starts very very slowly because the npm command (almost) never returns.

https://github.com/firebase/firebase-tools/blob/9e524c18f4038dfcadbab637c9f661165feb1753/src/deploy/functions/runtimes/node/versioning.ts#L62

[REQUIRED] Expected behavior

The emulator actually starts in a reasonable amount of time.

[REQUIRED] Actual behavior

The emulator does not start in < 60s.

stfsy avatar Oct 01 '22 19:10 stfsy

Hi everyone, i've been travelling a lot and noticed the emulator is unusable in the plane when there's no WIFI available. That is because the NPM command only returns after around a minute when no network is available. Quick and easy fix would be to add timeouts to the commands, or run them asynchronously.

stfsy avatar Oct 01 '22 19:10 stfsy

@bkendall @inlined what do you think? I created also PR #5055

stfsy avatar Dec 10 '22 19:12 stfsy