想问下 vue console 报错如何能跟踪到源 vue 文件

2020-12-08 18:10:18 +08:00
 phpxiaowangzi

如题,在调试中浏览器 console 报如下错误:

vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read property '_wrapper' of undefined at remove$2 (vue.runtime.esm.js?2b0e:6938) at updateListeners (vue.runtime.esm.js?2b0e:2220) at Array.updateDOMListeners (vue.runtime.esm.js?2b0e:6951) at patchVnode (vue.runtime.esm.js?2b0e:6314) at updateChildren (vue.runtime.esm.js?2b0e:6193) at patchVnode (vue.runtime.esm.js?2b0e:6319) at updateChildren (vue.runtime.esm.js?2b0e:6193) at patchVnode (vue.runtime.esm.js?2b0e:6319) at updateChildren (vue.runtime.esm.js?2b0e:6193) at patchVnode (vue.runtime.esm.js?2b0e:6319)

想问下这种如何能够定位到源 vue 文件是哪行吗?
1167 次点击
所在节点    程序员
4 条回复
overflow99
2020-12-08 18:38:00 +08:00
源文件是你的文件吗,你可以打开 webpack 的 SourceMap 配置试试
no1xsyzy
2020-12-08 18:56:12 +08:00
出错的地方和写错的代码差了十万八千里也有可能。
而且我直觉上你是这种情况。
还是看看你什么地方报错了,跟着线索走
ljpCN
2020-12-08 19:00:16 +08:00
sourcemap
konakona
2020-12-08 23:55:28 +08:00
sourcemap,太有用了,也是你唯一的选择。

http://www.ruanyifeng.com/blog/2013/01/javascript_source_map.html

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/733437

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX