滚滚向前
滚滚向前
  • 发布:2023-08-05 15:46
  • 更新:2024-08-01 17:52
  • 阅读:1569

云打包 报css错误​[ Selector `body` is not supported. nvue only support classname selector

分类:uni-app

项目中没有用到nvue页面,但是 云打包 编译的时候会大量输出一堆样式不支持的问题,如附件,如下。 不知道怎么解决此问题???

[HBuilder] 14:08:57.607 ​[plugin:vite:nvue-css] ERROR: Selector body is not supported. nvue only support classname selector
[HBuilder] 14:08:57.613 4 | 初始化
[HBuilder] 14:08:57.613 5 | ==================== /
[HBuilder] 14:08:57.617 6 | body {
[HBuilder] 14:08:57.629 | ^
[HBuilder] 14:08:57.630 7 | background-color: #f1f1f1;
[HBuilder] 14:08:57.636 8 | font-size: 28rpx;
[HBuilder] 14:08:57.636 at App.vue:1:0​
[HBuilder] 14:08:57.640 ​[plugin:vite:nvue-css] ERROR: Selector uni-view is not supported. nvue only support classname selector
[HBuilder] 14:08:57.644 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.648 11 | }
[HBuilder] 14:08:57.653 12 | uni-view,
[HBuilder] 14:08:57.653 | ^
[HBuilder] 14:08:57.657 13 | uni-scroll-view,
[HBuilder] 14:08:57.662 14 | uni-swiper,
[HBuilder] 14:08:57.676 at App.vue:1:0​
[HBuilder] 14:08:57.682 ​[plugin:vite:nvue-css] ERROR: Selector uni-scroll-view is not supported. nvue only support classname selector
[HBuilder] 14:08:57.683 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.687 11 | }
[HBuilder] 14:08:57.692 12 | uni-view,
[HBuilder] 14:08:57.696 | ^
[HBuilder] 14:08:57.700 13 | uni-scroll-view,
[HBuilder] 14:08:57.701 14 | uni-swiper,
[HBuilder] 14:08:57.706 at App.vue:1:0​
[HBuilder] 14:08:57.710 ​[plugin:vite:nvue-css] ERROR: Selector uni-swiper is not supported. nvue only support classname selector
[HBuilder] 14:08:57.714 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.719 11 | }
[HBuilder] 14:08:57.719 12 | uni-view,
[HBuilder] 14:08:57.723 | ^
[HBuilder] 14:08:57.726 13 | uni-scroll-view,
[HBuilder] 14:08:57.730 14 | uni-swiper,
[HBuilder] 14:08:57.734 at App.vue:1:0​
[HBuilder] 14:08:57.734 ​[plugin:vite:nvue-css] ERROR: Selector uni-button is not supported. nvue only support classname selector
[HBuilder] 14:08:57.738 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.741 11 | }
[HBuilder] 14:08:57.745 12 | uni-view,
[HBuilder] 14:08:57.748 | ^
[HBuilder] 14:08:57.752 13 | uni-scroll-view,
[HBuilder] 14:08:57.752 14 | uni-swiper,
[HBuilder] 14:08:57.756 at App.vue:1:0​
[HBuilder] 14:08:57.760 ​[plugin:vite:nvue-css] ERROR: Selector uni-input is not supported. nvue only support classname selector
[HBuilder] 14:08:57.764 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.768 11 | }
[HBuilder] 14:08:57.768 12 | uni-view,
[HBuilder] 14:08:57.772 | ^
[HBuilder] 14:08:57.776 13 | uni-scroll-view,
[HBuilder] 14:08:57.776 14 | uni-swiper,
[HBuilder] 14:08:57.780 at App.vue:1:0​
[HBuilder] 14:08:57.783 ​[plugin:vite:nvue-css] ERROR: Selector uni-textarea is not supported. nvue only support classname selector
[HBuilder] 14:08:57.784 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.787 11 | }
[HBuilder] 14:08:57.791 12 | uni-view,
[HBuilder] 14:08:57.794 | ^
[HBuilder] 14:08:57.798 13 | uni-scroll-view,
[HBuilder] 14:08:57.802 14 | uni-swiper,
[HBuilder] 14:08:57.802 at App.vue:1:0​
[HBuilder] 14:08:57.806 ​[plugin:vite:nvue-css] ERROR: Selector uni-label is not supported. nvue only support classname selector
[HBuilder] 14:08:57.810 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.814 11 | }
[HBuilder] 14:08:57.818 12 | uni-view,
[HBuilder] 14:08:57.818 | ^
[HBuilder] 14:08:57.821 13 | uni-scroll-view,
[HBuilder] 14:08:57.825 14 | uni-swiper,
[HBuilder] 14:08:57.829 at App.vue:1:0​
[HBuilder] 14:08:57.832 ​[plugin:vite:nvue-css] ERROR: Selector uni-navigator is not supported. nvue only support classname selector
[HBuilder] 14:08:57.833 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.836 11 | }
[HBuilder] 14:08:57.837 12 | uni-view,
[HBuilder] 14:08:57.841 | ^
[HBuilder] 14:08:57.844 13 | uni-scroll-view,
[HBuilder] 14:08:57.844 14 | uni-swiper,
[HBuilder] 14:08:57.848 at App.vue:1:0​
[HBuilder] 14:08:57.851 ​[plugin:vite:nvue-css] ERROR: Selector uni-image is not supported. nvue only support classname selector
[HBuilder] 14:08:57.855 10 | font-family: Helvetica Neue, Helvetica, sans-serif;
[HBuilder] 14:08:57.860 11 | }
[HBuilder] 14:08:57.860 12 | uni-view,
[HBuilder] 14:08:57.864 | ^
[HBuilder] 14:08:57.867 13 | uni-scroll-view,
[HBuilder] 14:08:57.872 14 | uni-swiper,
[HBuilder] 14:08:57.875 at App.vue:1:0​
[HBuilder] 14:08:57.876 ​[plugin:vite:nvue-css] ERROR: Selector uni-image is not supported. nvue only support classname selector
[HBuilder] 14:08:57.880 30 | 图片
[HBuilder] 14:08:57.884 31 | ====================
/
[HBuilder] 14:08:57.884 32 | uni-image {
[HBuilder] 14:08:57.888 | ^
[HBuilder] 14:08:57.891 33 | max-width: 100%;
[HBuilder] 14:08:57.891 34 | display: inline-block;
[HBuilder] 14:08:57.895 at App.vue:1:0​
[HBuilder] 14:08:57.906 ​[plugin:vite:nvue-css] ERROR: Selector uni-image.loading::before is not supported. nvue only support classname selector
[HBuilder] 14:08:57.912 36 | z-index: 0;
[HBuilder] 14:08:57.912 37 | }
[HBuilder] 14:08:57.923 38 | uni-image.loading::before {
[HBuilder] 14:08:57.929 | ^
[HBuilder] 14:08:57.934 39 | content: "";
[HBuilder] 14:08:57.934 40 | background-color: #f5f5f5;
[HBuilder] 14:08:57.938 at App.vue:1:0​
[HBuilder] 14:08:57.941 ​[plugin:vite:nvue-css] ERROR: Selector uni-image.loading::after is not supported. nvue only support classname selector
[HBuilder] 14:08:57.945 45 | z-index: -2;
[HBuilder] 14:08:57.957 46 | }
[HBuilder] 14:08:57.957 47 | uni-image.loading::after {
[HBuilder] 14:08:57.963 | ^
[HBuilder] 14:08:57.966 48 | content: "\e7f1";
[HBuilder] 14:08:57.969 49 | font-family: "cuIcon";
[HBuilder] 14:08:57.970 at App.vue:1:0​
[HBuilder] 14:08:57.974 ​[plugin:vite:nvue-css] ERROR: Selector uni-switch is not supported. nvue only support classname selector
[HBuilder] 14:08:57.979 70 | 开关
[HBuilder] 14:08:57.983 71 | ==================== /
[HBuilder] 14:08:57.983 72 | uni-switch,
[HBuilder] 14:08:57.986 | ^
[HBuilder] 14:08:57.990 73 | uni-checkbox,
[HBuilder] 14:08:57.994 74 | uni-radio {
[HBuilder] 14:08:57.994 at App.vue:1:0​
[HBuilder] 14:08:57.997 ​[plugin:vite:nvue-css] ERROR: Selector uni-checkbox is not supported. nvue only support classname selector
[HBuilder] 14:08:58.001 70 | 开关
[HBuilder] 14:08:58.005 71 | ====================
/
[HBuilder] 14:08:58.009 72 | uni-switch,
[HBuilder] 14:08:58.009 | ^
[HBuilder] 14:08:58.012 73 | uni-checkbox,
[HBuilder] 14:08:58.023 74 | uni-radio {
[HBuilder] 14:08:58.029 at App.vue:1:0​
[HBuilder] 14:08:58.033 ​[plugin:vite:nvue-css] ERROR: Selector uni-radio is not supported. nvue only support classname selector
[HBuilder] 14:08:58.034 70 | 开关
[HBuilder] 14:08:58.038 71 | ==================== */
[HBuilder] 14:08:58.042 72 | uni-switch,
[HBuilder] 14:08:58.045 | ^
[HBuilder] 14:08:58.057 73 | uni-checkbox,
[HBuilder] 14:08:58.058 74 | uni-radio {
[HBuilder] 14:08:58.063 at App.vue:1:0​
[HBuilder] 14:08:58.066 ​[plugin:vite:nvue-css] ERROR: Selector uni-switch::after is not supported. nvue only support classname selector
[HBuilder] 14:08:58.070 75 | position: relative;
[HBuilder] 14:08:58.070 76 | }
[HBuilder] 14:08:58.074 77 | uni-switch::after,
[HBuilder] 14:08:58.078 | ^
[HBuilder] 14:08:58.082 78 | uni-switch::before {
[HBuilder] 14:08:58.086 79 | font-family: "cuIcon";
[HBuilder] 14:08:58.087 at App.vue:1:0​
[HBuilder] 14:08:58.091 ​[plugin:vite:nvue-css] ERROR: Selector uni-switch::before is not supported. nvue only support classname selector
[HBuilder] 14:08:58.096 75 | position: relative;
[HBuilder] 14:08:58.100 76 | }
[HBuilder] 14:08:58.100 77 | uni-switch::after,
[HBuilder] 14:08:58.104 | ^
[HBuilder] 14:08:58.109 78 | uni-switch::before {
[HBuilder] 14:08:58.114 79 | font-family: "cuIcon";
[HBuilder] 14:08:58.118 at App.vue:1:0​
[HBuilder] 14:08:58.118 ​[plugin:vite:nvue-css] ERROR: Selector uni-switch::before is not supported. nvue only support classname selector
[HBuilder] 14:08:58.122 95 | margin: auto;
[HBuilder] 14:08:58.127 96 | }
[HBuilder] 14:08:58.130 97 | uni-switch::before {
[HBuilder] 14:08:58.134 | ^
[HBuilder] 14:08:58.134 98 | content: "\e646";
[HBuilder] 14:08:58.138 99 | right: 0;
[HBuilder] 14:08:58.142 at App.vue:1:0​
[HBuilder] 14:08:58.146 ​[plugin:vite:nvue-css] ERROR: Selector uni-switch[checked]::after is not supported. nvue only support classname selector
[HBuilder] 14:08:58.150 101| left: auto;
[HBuilder] 14:08:58.151 102| }

[HBuilder] 14:08:58.166 | ^
[HBuilder] 14:08:58.173 104| uni-switch.checked::after {
[HBuilder] 14:08:58.203 105| transform: scale(1, 1);
[HBuilder] 14:08:58.204 at App.vue:1:0​
[HBuilder] 14:08:58.209 ​[plugin:vite:nvue-css] ERROR: Selector uni-switch.checked::after is not supported. nvue only support classname selector
[HBuilder] 14:08:58.213 101| left: auto;
[HBuilder] 14:08:58.217 102| }

[HBuilder] 14:08:58.221 | ^
[HBuilder] 14:08:58.225 104| uni-switch.checked::after {
[HBuilder] 14:08:58.225 105| transform: scale(1, 1);
[HBuilder] 14:08:58.230 at App.vue:1:0​

2023-08-05 15:46 负责人:无 分享
已邀请:
1***@163.com

1***@163.com

两点可以处理:

  1. 确保manifest.json文件, "app-plus" ->"nvueStyleCompiler" : "uni-app"
  2. 对于注入全局的css,采取条件编译禁用掉

    <style>  
    /* #ifndef APP-PLUS-NVUE */  
    @import url('styles/tailwind.css');  
    * {  
    box-sizing: border-box;  
    }  
    /* #endif */  
    </style>
  • 1***@qq.com

    亲测 这个可以 好人

    2024-12-16 10:48

喜欢技术的前端

喜欢技术的前端 - QQ---445849201

可以看一下manifest.json->App常用其他配置 是不是勾选了纯nvue项目

要回复问题请先登录注册