-
Notifications
You must be signed in to change notification settings - Fork 927
Wrong type information for firebase.storage.UploadTask.on(.., .., error, ..)
#1515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The problem is also present with Firestore's types: |
Waiting for the solution, a workaround could be the explicit casting as follow: var error = <Firebase.FirebaseError>e; I guess this will work in the same way with your types @romain-faust Hope this helps |
Discussing internally for Firestore, changing We also need to audit our code to make sure we really do guarantee that it's always a FirestoreError. |
Any progress on this? Fixing this on the Firestore types would be nice as well. |
Thank you for bringing this back to our attention. We are re-evaluating the fix and will update this issue once a decision is made. |
Doing this for now
|
Update: The changes to the Firestore API are being reviewed internally. This API review process is standard for any changes to the public API. If approved, I'll merge #3418. I'm aiming for the first week of August 2020 to have it merged. |
Update: Make that the 2nd week of August 2020 :) |
The fix for Firestore has been merged: #3418. The fix for firebase.storage is still TODO. |
Describe your environment
Describe the problem
The
firebase.storage.UploadTask
interface has the methodon( .., .., error?: ((a: Error) => any) | null, ..)
.Checking the error code Error interface doesn't have the code property.
Steps to reproduce:
Using the example provided here, in the callback function for error a
switch-case
statement is used to switch among the error codes. The problem is that code is not recognized as property.Possible solution
I suppose the solution is to use
FirebaseError
instead ofError
line 720 of type definition.firebase-js-sdk/packages/storage-types/index.d.ts
Line 84 in 6b53e00
Thanks
The text was updated successfully, but these errors were encountered: