开发环境正常,生产环境报如下错误:
vendor.9aa51dcf.js:1 TypeError: l is not a function
    at eO (vendor.9aa51dcf.js:72)
    at JE (vendor.9aa51dcf.js:72)
    at vendor.9aa51dcf.js:77
    at E (vendor.9aa51dcf.js:77)
    at O (vendor.9aa51dcf.js:77)
    at uv (vendor.9aa51dcf.js:15)
    at vendor.9aa51dcf.js:15
    at ft.n [as effect] (vendor.9aa51dcf.js:1)
    at ft.get value [as value] (vendor.9aa51dcf.js:1)
    at it (vendor.9aa51dcf.js:1)
如何定位这类错误?
|  |      1Curtion      2021-05-21 21:11:19 +08:00 打开 sourceMap,看是哪里报错了 | 
|  |      2gzf6 OP @Curtion build 之后的文件,查看后是这里面的 l 报错,不知道具体对应哪里出错 ``` function mt(e, t, n, o=!0) { t && t.vnode; if (t) { let o = t.parent; const a = t.proxy , r = n; for (; o; ) { const t = o.ec; if (t) for (let n = 0; n < t.length; n++) if (!1 === t[n](e, a, r)) return; o = o.parent } const l = t.appContext.config.errorHandler; if (l) return void ht(l, null, 10, [e, a, r]) } !function(e, t, n, o=!0) { console.error(e) }(e, 0, 0, o) } ``` | 
|  |      3Curtion      2021-05-21 21:53:30 +08:00  1 https://vitejs.dev/config/#build-sourcemap  你在生产环境打开 sourcemap,然后就可以看到是哪报错了 | 
|      5lupkcd      2021-05-22 23:17:34 +08:00 同遇到 element-plus 非全局引入 设置语言为中文 生产报错 | 
|  |      6muunala10221      2021-05-24 18:21:02 +08:00 这好坑啊,最后怎么解决的 | 
|  |      7iamkun      2021-05-26 12:06:48 +08:00 方便提供一个可复现的 demo, 或贴一个 issue 地址? |