-
Notifications
You must be signed in to change notification settings - Fork 955
Closed
Description
[REQUIRED] Describe your environment
- Operating System version: MacOS 11.6
- Browser version: No Browser
- Firebase SDK version: 9.1.3
- Firebase Product:Storage
- Nodejs version: 14.18.0
[REQUIRED] Describe the problem
When I try to get the Storage DownloadURL with Nodejs, the getDownloadURL function works fine, but Nodejs doesn't finish running.
firebase-js-sdk should support the Nodejs environment.
https://firebase.google.com/docs/web/environments-js-sdk
Steps to reproduce:
Run the following code in Nodejs (14.18.0).
In my environment, Download URL is output normally, but Nodejs execution does not finish.
Relevant Code:
'use strict'
const { initializeApp } = require('firebase/app')
const { getStorage, ref, getDownloadURL } = require('firebase/storage')
initializeApp(
{
apiKey: '',
authDomain: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
appId: '',
measurementId: ''
}
)
!(async () => {
const storage = getStorage()
const pathReference = ref(storage, 'sample.txt')
const url = await getDownloadURL(pathReference)
console.log(url)
})()