这是indexloc提供的服务,不要输入任何密码
Skip to content

Firebase Storage getDownloadURL doesn't finish running #5628

@ulbqb

Description

@ulbqb

[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)
})()

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions