首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何处理目标firestore.googleapis.com:443代码的名称解析失败: 14

如何处理目标firestore.googleapis.com:443代码的名称解析失败: 14
EN

Stack Overflow用户
提问于 2020-04-17 00:07:13
回答 2查看 2.3K关注 0票数 2

如何以及在哪里处理此错误并阻止我的应用程序崩溃?

代码语言:javascript
复制
$ node app.js
Server Started at port 3000
events.js:200
      throw er; // Unhandled 'error' event
      ^

Error: 14 UNAVAILABLE: Name resolution failed for target firestore.googleapis.com:443
    at Object.callErrorFromStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\call.js:30:26)
    at Object.onReceiveStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\client.js:327:49)
    at Object.onReceiveStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:303:181)
    at Http2CallStream.outputStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\call-stream.js:114:27)
    at Http2CallStream.maybeOutputStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\call-stream.js:153:22)
    at Http2CallStream.endCall (D:\food_list\node_modules\@grpc\grpc-js\build\src\call-stream.js:140:18)
    at Http2CallStream.cancelWithStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\call-stream.js:441:14)
    at ChannelImplementation.tryPick (D:\food_list\node_modules\@grpc\grpc-js\build\src\channel.js:214:32)
    at ChannelImplementation._startCallStream (D:\food_list\node_modules\@grpc\grpc-js\build\src\channel.js:244:14)
    at Http2CallStream.start (D:\food_list\node_modules\@grpc\grpc-js\build\src\call-stream.js:418:22)
Emitted 'error' event on ClientReadableStreamImpl instance at:
    at Object.onReceiveStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\client.js:327:28)
    at Object.onReceiveStatus (D:\food_list\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:303:181)
    [... lines matching original stack trace ...]
    at Http2CallStream.start (D:\food_list\node_modules\@grpc\grpc-js\build\src\call-stream.js:418:22)
    at BaseStreamingInterceptingCall.start (D:\food_list\node_modules\@grpc\grpc-js\build\src\client-interceptors.js:275:19) {  code: 14,
  details: 'Name resolution failed for target firestore.googleapis.com:443',
  metadata: Metadata { internalRepr: Map {}, options: {} }
}

ps:当我在没有互联网的情况下运行应用程序时,应用程序崩溃。

EN

回答 2

Stack Overflow用户

发布于 2021-01-27 05:01:07

这是DNS错误。DNS是互联网连接中使用的一种服务。你的应用程序正在尝试访问互联网,特别是Firestore,但无法访问。这就是为什么会有错误。这个问题没有简单的解决办法,因为你还必须编程让应用程序在离线时运行的行为。

票数 1
EN

Stack Overflow用户

发布于 2020-04-25 01:04:17

错误堆栈跟踪显示:

代码语言:javascript
复制
Emitted 'error' event on ClientReadableStreamImpl instance at:

这意味着将引发错误,因为流正在发出错误事件,而您没有处理该事件。你可以通过在你正在读取的流上调用stream.on('error', callback)来解决这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61254821

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档