y***@163.com
y***@163.com
  • 发布:2025-10-16 11:34
  • 更新:2025-10-16 11:34
  • 阅读:26

【报Bug】使用cli命令行创建的项目,编译器由4.64更新为4.66后报错 @import "uview-plus/theme.scss"

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 4.76

手机系统: Android

手机系统版本号: Android 16

手机厂商: 华为

手机机型: p50

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

将@dcloudio/uni-开头的包,升级为4.66,运行项目终端就报错

预期结果:

终端不报错,页面正常展示

实际结果:

终端报错,页面样式失效

bug描述:

升级版本是因为云打包到真机运行,弹窗提示本应用使用HBuilderX 4.64 或对应的cli版本编译,而手机端SDK版本是 4.66。不匹配的版本可能造成应用异常。所以将项目中@dcloudio/uni-开头的包由3.0.0-4060420250429001升级为3.0.0-4060620250520001但是升级完之后运行项目终端就报以下错误,并且部分页面样式失效。只要将升级的版本回退到之前的,终端就不报错,页面样式也正常了 。将样式不正常的部分,4.64和4.66对比,发现4.66版本的多了几个样式属性,如附件3╷
11:20:06.849 14 │ @import "uview-plus/theme.scss";
11:20:06.849 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:06.849 ╵
11:20:06.849 node_modules\@dcloudio\uni-ui\lib\uni-easyinput\uni-easyinput.vue 14:9 root stylesheet
11:20:06.849 DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
11:20:06.849 More info and automated migrator: https://sass-lang.com/d/import
11:20:06.849 ╷
11:20:06.849 183 │ @import "uview-plus/theme.scss";
11:20:06.849 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:06.849 ╵
11:20:06.849 node_modules\@dcloudio\uni-ui\lib\uni-easyinput\uni-easyinput.vue 183:9 root stylesheet
11:20:06.945 DEPRECATION WARNING [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
11:20:06.945 More info: https://sass-lang.com/d/legacy-js-api
11:20:06.945 DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
11:20:06.945 More info and automated migrator: https://sass-lang.com/d/import
11:20:06.945 ╷
11:20:06.945 14 │ @import "uview-plus/theme.scss";
11:20:06.945 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:06.945 ╵
11:20:06.945 node_modules\uview-plus\components\u-badge\u-badge.vue 14:9 root stylesheet
11:20:06.945 DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
11:20:06.945 More info and automated migrator: https://sass-lang.com/d/import
11:20:06.945 ╷
11:20:06.945 183 │ @import "uview-plus/theme.scss";
11:20:06.945 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:06.945 ╵
11:20:06.945 node_modules\uview-plus\components\u-badge\u-badge.vue 183:9 root stylesheet
11:20:06.957 DEPRECATION WARNING [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
11:20:06.958 More info: https://sass-lang.com/d/legacy-js-api
11:20:06.958 DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
11:20:06.958 More info and automated migrator: https://sass-lang.com/d/import
11:20:06.958 ╷
11:20:06.958 14 │ @import "uview-plus/theme.scss";
11:20:06.958 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:06.958 ╵
11:20:06.958 node_modules\uview-plus\components\u-icon\u-icon.vue 14:9 root stylesheet
11:20:06.958 DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
11:20:06.958 More info and automated migrator: https://sass-lang.com/d/import
11:20:06.958 ╷
11:20:06.958 183 │ @import "uview-plus/theme.scss";
11:20:06.958 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:06.958 ╵
11:20:06.958 node_modules\uview-plus\components\u-icon\u-icon.vue 183:9 root stylesheet
11:20:07.082 DEPRECATION WARNING [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
11:20:07.082 More info: https://sass-lang.com/d/legacy-js-api
11:20:07.082 DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
11:20:07.083 More info and automated migrator: https://sass-lang.com/d/import
11:20:07.083 ╷
11:20:07.083 14 │ @import "uview-plus/theme.scss";
11:20:07.083 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:07.083 ╵
11:20:07.083 node_modules\uview-plus\components\u-safe-bottom\u-safe-bottom.vue 14:9 root stylesheet
11:20:07.083 DEPRECATION WARNING [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
11:20:07.083 More info and automated migrator: https://sass-lang.com/d/import
11:20:07.083 ╷
11:20:07.083 183 │ @import "uview-plus/theme.scss";
11:20:07.083 │ ^^^^^^^^^^^^^^^^^^^^^^^
11:20:07.084 ╵
11:20:07.084 node_modules\uview-plus\components\u-safe-bottom\u-safe-bottom.vue 183:9 root stylesheet
11:20:07.388 DEPRECATION WARNING [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
11:20:07.388 Use color.mix instead.
11:20:07.388 More info and automated migrator: https://sass-lang.com/d/import
11:20:07.388 ╷
11:20:07.388 304 │ color: mix(#fff, $uni-error, 50%);
11:20:07.388 │ ^^^^^^^^^^^^^^^^^^^^^^^^^^
11:20:07.389 ╵
11:20:07.389 node_modules\@dcloudio\uni-ui\lib\uni-easyinput\uni-easyinput.vue 304:11 root stylesheet

2025-10-16 11:34 负责人:无 分享
已邀请:

要回复问题请先登录注册