1

I've been trying to upload an image to Firebase storage on Angular. Here is a piece of code

const randomId = Math.random().toString(36).substring(2);
const ref = this.storage.ref(randomId);
const task = ref.put(file);

Error happens on the last line

I replaced the last line with another way to upload (according to angular documentation)

    const task = this.storage.upload(filePath, file);

But the same error happens

here is the error:

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)

0 Answers0