Open OlegGulevskyy opened 2 months ago
also hitting this issue, it was a pain in the ass to debug what was going on in the end I ended up running the script with deno just to rule out that it was some kind of issue with the firebase package itself and with deno it works as expected, didn't try node because everything is typescript and didn't feel like spending the time making it work
What version of Bun is running?
1.1.27
What platform is your computer?
Darwin 23.6.0 arm64 arm
What steps can reproduce the bug?
I run a small script to read values from Firebase using Bun. When the value is read I expect the process to be terminated but instead - it hangs without any errors or any further status updates. I need manually to Ctrl + C the running process to get out of it. The logic of reading the values are completed correctly, so no issues on that side - just once my script has run, I expect it to exit the process.
Initially reported in Discord here.
Here is a quick reproduction steps.
main.ts
with following contentexport const firebaseApp = firebase.initializeApp({ // Use default gcloud currently set authentication // Probs irrelevant to the actual Bun issue // Just make sure you can authenticate to a Firebase credential: applicationDefault(), databaseURL: FIREBASE_URL, });
// Set to whatever path you need to access const TARGET_FIREBASE_PATH = 'users/1';
const run = async () => { const value = await firebaseApp .database() .ref(TARGET_FIREBASE_PATH) // Might be the issue somewhere here, how this
once
is working .once('value');const val = value.val(); if (val === null) { console.error('No value found. Exiting...'); process.exit(0); // This is the only way to exit the process }
console.log(val); // Process is not exiting here, terminal just hangs around };
await run();