Firebase CLI: 6.9.2
Platform: macos, Windows
(Problem does not exist with CLI 6.8.0.)
Emulating the given HTTP trigger in a new project.
firebase init a new project space for Functionsfirebase emulators:start --only functions or firebase serve --only functions"Hello from Firebase!"
See the message on emulator output:
âš The Firebase Admin module has not been initialized early enough. Make sure you run "admin.initializeApp()" outside of any function and at the top of your code
The function will time out and disconnect as well. E.g:
curl: (52) Empty reply from server
same issue
same here
Add this in your index.ts file
const admin = require('firebase-admin')
try {
admin.initializeApp()
} catch (error) {
//TODO: ignoring until firebase-functions fix released
}
same issue
For everyone on this thread, are you all experiencing this on Windows or on other platforms as well?
Windows for me
Original issue states macos, Windows.
Gotcha, thanks missed that!
Windows
Firebase: 6.9.2
OS: macOS 10.14.3
Same here with Linux (Debian Stretch)
Firebase: 6.9.2
OS: Linux 4.19.26 x86_64
(setup is OK with @lionel95200x workaround)
Thanks for the help, working on a fix which should be merged in today.
Most helpful comment
Thanks for the help, working on a fix which should be merged in today.