akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.04k stars 1.51k forks source link

SassError: $n: List index may not be 0. #3008

Open smh53 opened 2 years ago

smh53 commented 2 years ago

I'm submitting a

[X] bug report [ ] feature request

I'm trying to install Nebular Auth to my project but when I add @include nb-auth-global(); to my styles.scss like this:

@use "~@nebular/auth/styles/globals" as *;
@import "themes";
@import "~@nebular/theme/styles/globals";

@include nb-install() {
  @include nb-theme-global();
  @include nb-auth-global();
}

I'm getting this error:

./src/styles.scss - Error: 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: $n: List index may not be 0.
   ╷
21 │   @return nth($themes, length($themes));
   │           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  node_modules\@nebular\theme\styles\core\theming\_register.scss 21:11                     get-last-enabled-theme()
  node_modules\@nebular\theme\styles\core\theming\_get-value.scss 30:11                    get-current-theme-name()
  node_modules\@nebular\theme\styles\core\theming\_get-value.scss 51:23                    nb-theme()
  node_modules\@nebular\auth\components\auth-block\_auth-block.component.theme.scss 12:14  nb-auth-block-theme()
  node_modules\@nebular\auth\styles\global\_components.scss 11:3                           nb-auth-components()
  node_modules\@nebular\auth\styles\_globals.scss 10:3                                     nb-auth-global()
  src\styles.scss 7:3                                                                      @content
  node_modules\@nebular\theme\styles\core\theming\_install.scss 149:7                      @content
  node_modules\@nebular\theme\styles\core\theming\_install.scss 135:7                      nb-install-global-with-scss-vars()
  node_modules\@nebular\theme\styles\core\theming\_install.scss 148:5                      nb-install()
  src\styles.scss 5:1                                                                      root stylesheet
    at processResult (C:\Users\Semih TAVUKCU\Desktop\Projeler\BIESSE_OCR_FRONTEND\biesse-ocr\node_modules\webpack\lib\NormalModule.js:713:19)
    at C:\Users\Semih TAVUKCU\Desktop\Projeler\BIESSE_OCR_FRONTEND\biesse-ocr\node_modules\webpack\lib\NormalModule.js:819:5
    at C:\Users\Semih TAVUKCU\Desktop\Projeler\BIESSE_OCR_FRONTEND\biesse-ocr\node_modules\loader-runner\lib\LoaderRunner.js:399:11
    at C:\Users\Semih TAVUKCU\Desktop\Projeler\BIESSE_OCR_FRONTEND\biesse-ocr\node_modules\loader-runner\lib\LoaderRunner.js:251:18
    at context.callback (C:\Users\Semih TAVUKCU\Desktop\Projeler\BIESSE_OCR_FRONTEND\biesse-ocr\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
    at Object.callback (C:\Users\Semih TAVUKCU\Desktop\Projeler\BIESSE_OCR_FRONTEND\biesse-ocr\node_modules\sass-loader\dist\index.js:54:7)
    at Worker.<anonymous> (C:\Users\Semih TAVUKCU\Desktop\Projeler\BIESSE_OCR_FRONTEND\biesse-ocr\node_modules\@angular-devkit\build-angular\src\sass\sass-service.js:134:25)
    at Worker.emit (events.js:400:28)
    at MessagePort.<anonymous> (internal/worker.js:215:53)
    at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:399:24)

× Failed to compile.

Angular CLI: 12.2.14 Node: 14.17.6 Package Manager: npm 6.14.15 OS: win32 x64 Angular: 12.2.15 Nebular : 9.0.0

smh53 commented 2 years ago

For those having the same problem: I have uninstalled auth version 9.0.0 and installed version 8.0.0 like this :
npm uninstall @nebular/auth npm i @nebular/auth@^8

and everything works for now. But I will keep this issue open since this is not a healthy solution.

Whisper40 commented 2 years ago

Same here.. @smh53 Did you find a solution ?

smh53 commented 2 years ago

@Whisper40 No I did not, sorry