今天维护一个公司之前的react项目 出现了如下警告
不明所以 o((⊙﹏⊙))o 记录下解决过程

在这里插入图片描述

./src/compontents/Pay/index.styl (./node_modules/css-loader/dist/cjs.js??ref–6-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/stylus-loader??ref–6-oneOf-6-3!./src/compontents/Pay/index.styl)

方法一:
尝试

npm uninstall node-sass;

npm install node-sass@4.14.1

node-sass这个包是干嘛的??不知道
试了一下没用 这个时候我仔细定睛一看
发现跟styl 跟这个格式的样式文件有关系;

方法二:
发现我自己的package.json 文件中没有相关的loader “stylus”: “^0.54.5”, “stylus-loader”: “^3.0.2”,
于是我安装后 再次测试 无效
stylus 这种样式 没用过,不知道好不好用 和less 和sass又有什么区别?有时间学习学习
stylus官网 http://stylus-lang.com/
stylus中文网 https://stylus-lang.net/

方法三:
翻一下报错后面的这句话 看看有没有什么突破点
在这里插入图片描述

Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole
block, not to next rules.

第二个 Autoprefixer 控件注释被忽略。 Autoprefixer 将控制注释应用于整个块,而不是下一个规则。

好家伙 就是这个东西在作祟; 报错的styl样式文件中都有

  			 /* autoprefixer: off */
            -webkit-box-orient: vertical;
            /* autoprefixer: on */
            -webkit-line-clamp: 2;

将 带有 autoprefixer 的注释删除就好了;

但是话说autoprefixer 是个啥东西 百度了一下:

Autoprefixer:一个以最好的方式处理浏览器前缀的后处理程序 (⊙_⊙)?

还有很多东西都不会;
① styl 样式
② Autoprefixer
③ node-sass

有空一定补充学习

记录 共勉~❀❀

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐