uni-app cli项目运行h5的时候控制台报错怎么解决

uni-app cli项目运行h5的时候控制台报错怎么解决

类别 信息
产品分类 uniapp/H5
PC开发环境 Windows
操作系统版本 Windows11
HBuilderX类型 正式
HBuilderX版本 4.76
浏览器 Chrome
浏览器版本 122.0.6261.95
项目创建方式 HBuilderX

操作步骤:

  • 运行h5

预期结果:

  • 运行h5

实际结果:

  • 运行h5

bug描述:

Uncaught SyntaxError: The requested module '/node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js?v=950ebf80' does not provide an export named 'CompileErrorCodes' (at core-base.mjs?v=950ebf80:7:28)

更多关于uni-app cli项目运行h5的时候控制台报错怎么解决的实战教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

i18n用的什么版本?你是cli项目还是hx项目?

更多关于uni-app cli项目运行h5的时候控制台报错怎么解决的实战教程也可以访问 https://www.itying.com/category-93-b0.html


这个错误通常是由于 Vue I18n 相关的依赖版本兼容性问题导致的。[@intlify](/user/intlify)/message-compiler 模块的导出方式与当前项目中的 Vue I18n 版本不匹配。

解决方案:

  1. 更新依赖版本

    • 执行 npm updateyarn upgrade 更新所有依赖到最新兼容版本
    • 或者单独更新 Vue I18n 相关包:
    npm install vue-i18n[@latest](/user/latest) [@intlify](/user/intlify)/core[@latest](/user/latest) [@intlify](/user/intlify)/message-compiler[@latest](/user/latest)
    
  2. 清理缓存并重新安装

    rm -rf node_modules package-lock.json
    npm install
回到顶部