Open takahashi-shotaro-al opened 6 months ago
Hey @takahashi-shotaro, thanks for the detailed report and for sharing your observations. I was able to reproduce the issue, and it does sound reasonable to increase the timeout on use-cases where the emulators are being run on a low-spec machine or if there are a lot of dependencies which is causing the functions to load longer than expected.
I’ll raise this to our engineering team so they can take a look. Also, thanks for submitting a PR!
I forgot to mention that the same problem occurs when deploying functions.
That's a great observation and helped point us to a very surgical fix!
[REQUIRED] Environment info
firebase-tools: 13.8.3 firebase-admin: 12.1.0 firebase-functions: 5.0.1
Platform: Windows 11 node: 20.5.1
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
No error should have occured
[REQUIRED] Actual behavior
error
functions: Failed to load function definition from source: FirebaseError: User code failed to load. Cannot determine backend specification
npm run serve (firebase emulators:start --only functions --debug)
node -r .
Misc
similar issue: https://github.com/firebase/firebase-tools/issues/5888
On Windows, loading our production code entry point by require() takes 8~ seconds.