V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gancl
V2EX  ›  React

react electron webpack 怎么取消压缩代码, 不然客户端报错都定位不到在哪一行报错

  •  
  •   gancl · 2018-10-22 22:11:23 +08:00 · 2013 次点击
    这是一个创建于 1984 天前的主题,其中的信息可能已经有所发展或是发生改变。

    react electron 遇到崩溃就白屏,给组件加了<errorboundary>虽然被捕获但是不能定位到具体哪一行,只能让客户不能用了再重启. 要怎么解决? 正式发布的代码都压缩了没法看报错在哪一行</errorboundary>

    4 条回复    2018-10-22 23:17:07 +08:00
    gancl
        1
    gancl  
    OP
       2018-10-22 22:17:04 +08:00
    我的项目里都没配置 uglifyjs
    Trim21
        2
    Trim21  
       2018-10-22 22:21:55 +08:00 via Android
    启用一下 source map ?
    gancl
        3
    gancl  
    OP
       2018-10-22 23:16:48 +08:00
    怎么启用 source map ? 启用了通过报错堆栈就可以马上定位到哪一行代码吗? 通过都是如"UserName" of undefined
    gancl
        4
    gancl  
    OP
       2018-10-22 23:17:07 +08:00
    #2 @Trim21 怎么启用 source map ? 启用了通过报错堆栈就可以马上定位到哪一行代码吗? 通过都是如"UserName" of undefined
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2422 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:06 · PVG 00:06 · LAX 09:06 · JFK 12:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.