版本不兼容问题
events.js:174
throw er; // Unhandled 'error' event
^
Error: node_modules/element-theme-chalk/src/avatar.scss
Error: Undefined variable: "$--avatar-font-color".
on line 9 of node_modules/element-theme-chalk/src/avatar.scss, in mixin @content
from line 74 of node_modules/element-theme-chalk/src/mixins/mixins.scss, in mixin b
from line 4 of node_modules/element-theme-chalk/src/avatar.scss
color: $--avatar-font-color; 产生上述错误,版本信息为: "element-theme-chalk": "^2.11.1", "element-ui": "2.9.1", 调整chalk版本,问题得到解决 "element-theme-chalk": "^2.9.2"
I'm also having the same issue with:
"element-ui": "^2.11.1",
"element-theme": "^2.0.1",
"element-theme-chalk": "^2.11.1",
⠸ build element theme
events.js:174
throw er; // Unhandled 'error' event
^
Error: node_modules/element-theme-chalk/src/avatar.scss
Error: Undefined variable: "$--avatar-font-color".
on line 9 of node_modules/element-theme-chalk/src/avatar.scss, in mixin `@content`
from line 74 of node_modules/element-theme-chalk/src/mixins/mixins.scss, in mixin `b`
from line 4 of node_modules/element-theme-chalk/src/avatar.scss
>> color: $--avatar-font-color;
---------^
Seems the issue is because of the addition of the Avatar component in https://github.com/ElementUI/theme-chalk/commit/d1968d4449d1f5c94dcde82bc89f1e74669dcbd0
在 element-variables.scss 这个文件里,把缺少的变量定义一下就行了。
具体定义的值是什么,可以看 element-theme-chalk, lib 中对应 css 文件的代码,找到报错的 css 属性和值。
楼上的报错信息看,是去 node_modules/element-theme-chalk/lib/avatar.css 下,找 color 的属性。
当然你也可以跳过,直接写 ‘default’ 之类的属性值。
比如:
$--avatar-font-color: 'unset';
问题出现的原因不确定,估计是 element-theme 的 bug.