Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在浏览器中获取未处理承诺拒绝的来源?_Javascript_Vue.js_Promise_Vue Apollo - Fatal编程技术网

Javascript 如何在浏览器中获取未处理承诺拒绝的来源?

Javascript 如何在浏览器中获取未处理承诺拒绝的来源?,javascript,vue.js,promise,vue-apollo,Javascript,Vue.js,Promise,Vue Apollo,我目前面临一个无法复制的错误 我的前端错误记录器是Bugsnag,前端使用Vue.js/Vue router/Vue apollo Graphql 我有时会在Bugsnag中出现错误,比如:未处理的Rejection处理程序收到了一个非错误。这样:没有文件,没有堆栈跟踪 出现此错误的用户操作是从一个页面转到另一个页面,每次都是相同的源和目的地,但我无法在本地或生产中复制。我不知道该用户是否被阻止,或者该错误是否对他没有影响 我尝试使用日志记录更多信息,但我得到的唯一信息是: 但当我创造自己的未经

我目前面临一个无法复制的错误

  • 我的前端错误记录器是Bugsnag,前端使用Vue.js/Vue router/Vue apollo Graphql
  • 我有时会在Bugsnag中出现错误,比如:
    未处理的Rejection处理程序收到了一个非错误
    。这样:没有文件,没有堆栈跟踪
  • 出现此错误的用户操作是从一个页面转到另一个页面,每次都是相同的源和目的地,但我无法在本地或生产中复制。我不知道该用户是否被阻止,或者该错误是否对他没有影响
  • 我尝试使用日志记录更多信息,但我得到的唯一信息是:
  • 但当我创造自己的未经处理的拒绝承诺时,我可以得到这样的东西:

    UnhandledPromiseRejectionWarning
    [ Stacktrace altered by https://github.com/grantila/trace-unhandled ]
    Unknown error
        ==== Promise at: ==================
        at eval (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vuetify-loader/lib/loader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js&:127:9)
        at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vuetify-loader/lib/loader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js& (http://....../js/23.js:23:1)
        at __webpack_require__ (http://....../js/app.js:790:30)
        at fn (http://....../js/app.js:151:20)
        at eval (webpack-internal:///./src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js&:2:339)
        at Module../src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js& (http://....../js/23.js:107:1)
        at __webpack_require__ (http://....../js/app.js:790:30)
        at fn (http://....../js/app.js:151:20)
        at eval (webpack-internal:///./src/components/pages/Customer/CurrentCases.vue:3:100)
        at Module../src/components/pages/Customer/CurrentCases.vue (http://....../js/23.js:95:1)
        at __webpack_require__ (http://....../js/app.js:790:30)
        at fn (http://....../js/app.js:151:20)
    
        ==== Error at: ====================
    
    
        ==== Shared trace: ================
    
    所以,我的问题是:
    如何在浏览器中找到更多关于拒绝承诺的来源的信息?

    查看所有
    reject
    调用和
    throw
    语句,找到使用非错误对象值的语句。一根短绒可能会对此有所帮助,尤其是当你使用typescript时。谢谢@Bergi。我已经在我们自己的代码库中搜索过了,我没有找到类似的东西。它可能在依赖项中,但使用的依赖项经过了很好的测试:Apollo、vue。。。我不认为我是唯一一个有这种感觉的人。顺便说一句,我们不使用类型脚本:(我想你只能尝试用
    .catch(e=>{throw(e instanceof Error)?e:new Error(`unknown${e}位于文件x行y`);})乱丢你的承诺链。
    UnhandledPromiseRejectionWarning
    [ Stacktrace altered by https://github.com/grantila/trace-unhandled ]
    Unknown error
        ==== Promise at: ==================
        at eval (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vuetify-loader/lib/loader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js&:127:9)
        at Module../node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vuetify-loader/lib/loader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js& (http://....../js/23.js:23:1)
        at __webpack_require__ (http://....../js/app.js:790:30)
        at fn (http://....../js/app.js:151:20)
        at eval (webpack-internal:///./src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js&:2:339)
        at Module../src/components/pages/Customer/CurrentCases.vue?vue&type=script&lang=js& (http://....../js/23.js:107:1)
        at __webpack_require__ (http://....../js/app.js:790:30)
        at fn (http://....../js/app.js:151:20)
        at eval (webpack-internal:///./src/components/pages/Customer/CurrentCases.vue:3:100)
        at Module../src/components/pages/Customer/CurrentCases.vue (http://....../js/23.js:95:1)
        at __webpack_require__ (http://....../js/app.js:790:30)
        at fn (http://....../js/app.js:151:20)
    
        ==== Error at: ====================
    
    
        ==== Shared trace: ================