1

If you try just install Nebular Auth Module probably you is face this error below.

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

What to do?

btd1337
  • 2,616
  • 2
  • 16
  • 25

2 Answers2

1

The solution is to create an src/themes.scss file like this:

@import '~@nebular/theme/styles/theming';
@import '~@nebular/theme/styles/themes/default';

$nb-themes: nb-register-theme((), default, default);

and to add this import in 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();
};

Make sure you have nebular theme css imported in angular.json:

"styles": [
    "node_modules/@nebular/theme/styles/prebuilt/default.css",
    "src/styles.scss"
],
btd1337
  • 2,616
  • 2
  • 16
  • 25
0

ANGULAR V15.0.0

do not use "~"

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' as*;

@import "@nebular/theme/styles/globals";
@import '@nebular/auth/styles/globals';

@include nb-install() {
    @include nb-theme-global();
    @include nb-auth-global();
};
matias
  • 1
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 16 '23 at 20:30