使用nuxt js ssr 之后,出现报错堆栈信息无法看到准确信息
发布于 6 年前 作者 scalaview 2884 次浏览 来自 问答

一般js编译之后,报错出现的堆栈信息都是编译后的位置,看不出具体在代码哪一行

例如报错出现这种,只知道503但是不知道哪个连接访问503 也不知道在哪个代码行报错。 请问类似这种编译后的代码的报错堆栈怎样才能把比较准确,更多的信息打印出来

  at renderComponent (node_modules/vue-server-renderer/build.js:7488:5)
 at renderNode (node_modules/vue-server-renderer/build.js:7404:5)

 (node:56785) UnhandledPromiseRejectionWarning: Error: Request failed with status code 503
   at createError (/var/www/mobile/releases/20190104205921/node_modules/axios/lib/core/createError.js:16:15)
  at settle (/var/www/mobile/releases/20190104205921/node_modules/axios/lib/core/settle.js:18:12)
   at IncomingMessage.handleStreamEnd (/var/www/mobile/releases/20190104205921/node_modules/axios/lib/adapters/http.js:192:11)
  at IncomingMessage.emit (events.js:187:15)
  at IncomingMessage.EventEmitter.emit (domain.js:442:20)
  at IncomingMessage.wrapped (/var/www/mobile/releases/20190104205921/node_modules/newrelic/lib/transaction/tracer/index.js:181:22)
   at IncomingMessage.wrappedResponseEmit (/var/www/mobile/releases/20190104205921/node_modules/newrelic/lib/instrumentation/core/http-outbound.js:98:26)
    at endReadableNT (_stream_readable.js:1094:12)
    at wrapped (/var/www/mobile/releases/20190104205921/node_modules/newrelic/lib/transaction/tracer/index.js:181:22)
   at args.(anonymous function) (/usr/local/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:138:29)
回到顶部