9***@qq.com
9***@qq.com
  • 发布:2024-06-21 10:08
  • 更新:2024-08-01 12:38
  • 阅读:368

【报Bug】跑h5时vue.runtime.esm.js文件报错,因为引入了两个不存在的方法isMathMLTag、isRenderableAttrValue

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: window 10

浏览器平台: Chrome

浏览器版本: 125.0.6422.142

项目创建方式: CLI

CLI版本号: 4.5.17

示例代码:

依赖:

    "@common/wx-miniprogram-monitor": "^1.2.1",  
    "@dcloudio/uni-app": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-app-harmony": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-app-plus": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-components": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-h5": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-alipay": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-baidu": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-jd": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-lark": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-qq": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-weixin": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-mp-xhs": "3.0.0-alpha-4010520240507001",  
    "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001",  
    "@rollup/plugin-replace": "^5.0.1",  
    "dayjs": "^1.11.10",  
    "dotenv": "^16.4.5",  
    "less": "^4.2.0",  
    "less-loader": "^12.1.0",  
    "miniprogram-ci": "^1.9.15",  
    "sass": "^1.70.0",  
    "sass-loader": "^14.0.0",  
    "vue": "3.4.21",  
    "vue-i18n": "9.13.1",  
    "vuex": "^4.1.0"  

    "@csstools/postcss-sass": "^5.1.1",  
    "@dcloudio/types": "3.4.8",  
    "@dcloudio/uni-automator": "3.0.0-4000820240401001",  
    "@dcloudio/uni-cli-shared": "3.0.0-4000820240401001",  
    "@dcloudio/uni-stacktracey": "3.0.0-4000820240401001",  
    "@dcloudio/uni-ui": "^1.5.0",  
    "@dcloudio/vite-plugin-uni": "3.0.0-4000820240401001",  
    "@rollup/plugin-strip": "^3.0.4",  
    "@vue/runtime-core": "3.4.21",  
    "eslint": "^8.56.0",  
    "eslint-config-standard": "^17.1.0",  
    "eslint-plugin-import": "^2.29.1",  
    "eslint-plugin-n": "^16.6.2",  
    "eslint-plugin-promise": "^6.1.1",  
    "eslint-plugin-vue": "^9.20.1",  
    "install": "^0.13.0",  
    "npm": "^10.5.0",  
    "postcss": "^8.4.38",  
    "postcss-preset-env": "^9.5.2",  
    "rollup-plugin-replace": "^2.2.0",  
    "vite": "4.3.5"

操作步骤:

用对应版本的uniapp本地运行npm run dev:h5就行

我发现@vue/share的3.3.11版本没有isMathMLTag方法,但是@vue/share最新版是有的,而uniapp框架中有不少地方用了3.3.11

预期结果:

代码不报错

实际结果:

代码报错

Uncaught SyntaxError: The requested module '/node_modules/@vue/shared/dist/shared.esm-bundler.js' does not provide an export named 'isMathMLTag' (at vue.runtime.esm.js:6:575)

bug描述:

如图,这两个方法根本不存在,怕不是被哪位大佬删除了吧[狗头]。现在项目很急,麻烦哪位大佬看看

2024-06-21 10:08 负责人:无 分享
已邀请:
5***@qq.com

5***@qq.com

解决了吗,同问

1***@qq.com

1***@qq.com

解决了吗,h5就会,已经更新到3.0.0-4020420240722002 还是会,都最新版了

1***@sina.cn

1***@sina.cn

有没有大佬解决了呀 请指导一下 求

1***@sina.cn

1***@sina.cn

随便尝试了一下,不知道isRenderableAttrValue的作用是什么,随便定义了一下在导出 反正是不报错了,如果有大佬有新的解决方案,求告知

2***@qq.com

2***@qq.com

把vue版本升级到3.4.21

PengGG

PengGG - 前端小白

https://uniapp.dcloud.net.cn/vue3-ts-cli-release.html
尝试了一下,按照官方文档的版本号 替换 即可 解决

要回复问题请先登录注册