React native 反应本机thunk“;可能未处理的承诺”;尽管提供了onReject回调,但仍出错?

React native 反应本机thunk“;可能未处理的承诺”;尽管提供了onReject回调,但仍出错?,react-native,google-cloud-firestore,redux-thunk,React Native,Google Cloud Firestore,Redux Thunk,使用react native,在redux action thunk()中使用firebase.Promise()时,会出现可能未处理的承诺拒绝错误,例如 (此处建议的身份验证()通过重新身份验证和使用凭据的检索数据())生成消息 不打印console.log()消息(这向我表明这不仅仅是一个警告,而是一个实际错误)。即使我向.then()()提供了一个onReject回调 其他一些SO帖子建议在承诺中附加一个.catch()(而不是像我一样在承诺的.then()中提供on-onReject回退

使用react native,在redux action thunk()中使用firebase.Promise()时,会出现
可能未处理的承诺拒绝
错误,例如


(此处建议的身份验证()通过
重新身份验证和使用凭据的检索数据
())生成消息

不打印console.log()消息(这向我表明这不仅仅是一个警告,而是一个实际错误)。即使我向
.then()
()提供了一个
onReject
回调


其他一些SO帖子建议在承诺中附加一个
.catch()
(而不是像我一样在承诺的.then()中提供on-onReject回退回调),但是由于我在这里使用了thunk操作,因此不建议这样做(请参阅)。有人知道这里会发生什么或需要进一步调试的步骤吗?

重新验证和使用凭据检索数据是您编写的函数(如包装器),还是firebase中的内置API?。如果可能,您可以显示
reaauthenticateandretrievedatawithcredential
的代码吗?@RaviRaj这是一个firestore web API函数(旧函数
reaauthenticatewithcredential
现在已折旧())。在问题中添加了指向文档的链接。
....
console.log(`Reuthenticating for user ${user.displayName}, ${user.email}`)
credentials = 'intentionally bad credential type'
user.reauthenticateAndRetrieveDataWithCredential(credentials)
.then(
    (res) => {console.log(`Reauth complete: ${res}`)},
    (error) => {console.log(`Something bad happend ${error}`)})
....
[18:45:12] Reuthenticating for user me, me@gmail.com
[18:45:14] Possible Unhandled Promise Rejection (id: 0):
[18:45:14] [Error: reauthenticateAndRetrieveDataWithCredential failed: First argument "credential" must be a valid credential.]