TypeError: firebase.storage is not a function

前端 未结 14 1246
予麋鹿
予麋鹿 2020-11-27 14:47

Following this example, I keep getting the error:

 TypeError: firebase.storage is not a function

From this line in my code:



        
14条回答
  •  甜味超标
    2020-11-27 15:23

    Does it change if you try to do it like the following?

    // Initialize the default app:
    const app = firebase.initializeApp(appConfig)
    
    // Initialize storage from the *app* object:
    const storage = app.storage()
    

    From the docs, it seems that this is an alternate method. I prefer this one, as this links the storage to the app, making the code more readable, and more functional

提交回复
热议问题