我一直试图将图像上传到Angular上的Firebase存储。这是一段代码
const randomId = Math.random().toString(36).substring(2);
const ref = this.storage.ref(randomId);
const task = ref.put(file);
错误发生在最后一行
我用另一种上传方式替换了最后一行(根据角度文档)
const task = this.storage.upload(filePath, file);
但是发生同样的错误
这是错误:
ERROR Error: [object Object]
at viewWrappedDebugError (core.js:22194)
at callWithDebugContext (core.js:36417)
at Object.debugHandleEvent [as handleEvent] (core.js:36043)
at dispatchEvent (core.js:22533)
at core.js:33721
at HTMLButtonElement.<anonymous> (platform-browser.js:1789)
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:30885)
at ZoneDelegate.invokeTask (zone-evergreen.js:390)
at Zone.runTask (zone-evergreen.js:168)