• 请不要在回答技术问题时复制粘贴 AI 生成的内容
phpxiaowangzi
V2EX  ›  程序员

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

  •  
  •   phpxiaowangzi · Dec 8, 2020 · 1791 views
    This topic created in 2008 days ago, the information mentioned may be changed or developed.

    如题,在调试中浏览器 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 文件是哪行吗?
    
    4 replies    2020-12-08 23:55:28 +08:00
    y4ZIZrCL74b9MYl6
        1
    y4ZIZrCL74b9MYl6  
       Dec 8, 2020
    源文件是你的文件吗,你可以打开 webpack 的 SourceMap 配置试试
    no1xsyzy
        2
    no1xsyzy  
       Dec 8, 2020
    出错的地方和写错的代码差了十万八千里也有可能。
    而且我直觉上你是这种情况。
    还是看看你什么地方报错了,跟着线索走
    ljpCN
        3
    ljpCN  
       Dec 8, 2020 via iPhone
    sourcemap
    konakona
        4
    konakona  
       Dec 8, 2020
    sourcemap,太有用了,也是你唯一的选择。

    http://www.ruanyifeng.com/blog/2013/01/javascript_source_map.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1646 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 16:22 · PVG 00:22 · LAX 09:22 · JFK 12:22
    ♥ Do have faith in what you're doing.