如果你尝试只安装Nebular Auth Module,你可能会遇到下面这个错误。
Error: ./src/styles.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.
╷
5 │ ┌ @include nb-install() {
6 │ │ @include nb-theme-global();
7 │ │ @include nb-auth-global();
8 │ │ };
│ └─^
╵
src/styles.scss 5:1 root stylesheet该怎么办呢?
发布于 2020-12-28 11:34:25
解决方案是创建一个src/themes.scss文件,如下所示:
@import '~@nebular/theme/styles/theming';
@import '~@nebular/theme/styles/themes/default';
$nb-themes: nb-register-theme((), default, default);并在src/styles.scss中添加此导入
@import 'themes';
@import "~@nebular/theme/styles/globals";
@import '~@nebular/auth/styles/globals';
@include nb-install() {
@include nb-theme-global();
@include nb-auth-global();
};确保在angular.json中导入了nebular theme css
"styles": [
"node_modules/@nebular/theme/styles/prebuilt/default.css",
"src/styles.scss"
],https://stackoverflow.com/questions/65472724
复制相似问题