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

vue3 的原生页面用 babel 转码后为什么还是会报错

  •  
  •   RunningDurian · 2021-10-14 18:06:39 +08:00 · 573 次点击
    这是一个创建于 895 天前的主题,其中的信息可能已经有所发展或是发生改变。

    就是标签引入的 js 文件,而且我把 vue,elementui,config 等全部转了 es2015

    没转之前的 报错内容: SCRIPT1014: 无效字符 config.js (2,33) SCRIPT1055: const 赋值 babel.min.js (1,730923) SCRIPT1003: 缺少 ':' index.html (716,30) 转了之后: SCRIPT7002: XMLHttpRequest: 网络错误 0x2efd, 由于出现错误 00002efd 而导致此项操作无法完成。 index.html [Vue warn]: Error in created hook: "TypeError: 无法获取未定义或 null 引用的属性“markInfo”"

    (found in <Root>) TypeError: 无法获取未定义或 null 引用的属性“markInfo” { [functions]: , proto: { }, description: "无法获取未定义或 null 引用的属性“markInfo”", message: "无法获取未定义或 null 引用的属性“markInfo”", name: "TypeError", number: -2146823281, stack: "TypeError: 无法获取未定义或 null 引用的属性“markInfo” at getCustInfo (file:///G:/jt/sszj/agent_front%20-%20 副本 /index.html:846:9) at created (file:///G:/jt/sszj/agent_front%20-%20 副本 /index.html:626:9) at invokeWithErrorHandling (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:286:403) at callHook (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:558:119) at Vue.prototype._init (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:667:1) at Vue (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:672:559) at Global code (file:///G:/jt/sszj/agent_front%20-%20 副本 /index.html:620:1)" } [Vue warn]: Error in render: "ReferenceError: “userForm_1”未定义" (found in <Root>) ReferenceError: “userForm_1”未定义 { [functions]: , proto: { }, description: "“userForm_1”未定义", message: "“userForm_1”未定义", name: "ReferenceError", number: -2146823279, stack: "ReferenceError: “userForm_1”未定义 at Function code (Function code:1:12) at Vue.prototype._render (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:495:29) at updateComponent (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:532:1038) at get (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:614:89) at Watcher (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:612:272) at mountComponent (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:535:1) at Vue.prototype.$mount (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:1031:82) at Vue.prototype.$mount (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:1242:1021) at Vue.prototype._init (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:667:198) at Vue (file:///G:/jt/sszj/agent_front%20-%20 副本 /js/vue.js:672:559)" }

    DimitriYoon
        1
    DimitriYoon  
       2021-10-15 10:35:06 +08:00
    这报错信息貌似是代码的问题,"markinfo"没找到,应该是你哪里用了异步导致 markinfo 没渲染出来或者没加载出来就提前调用了,建议检查一下代码,和 babel 有啥关系吗...
    RunningDurian
        2
    RunningDurian  
    OP
       2021-10-15 14:56:30 +08:00
    哎,我是直接用 babel 转的,网上对应的资料也太少了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5482 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 08:23 · PVG 16:23 · LAX 01:23 · JFK 04:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.