Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstraap\SASS: Wrong number of arguments (3 for 2) for `table-row-variant'

Just recently updated to angular 8 and I can't seem to solve this issue.

Here is the error

ERROR in ./src/vendor/styles/bootstrap-material.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/vendor/styles/bootstrap-material.scss)

Module build failed (from ./node_modules/sass-loader/lib/loader.js):

@include table-row-variant($color, theme-color-level($color, $table-bg-level), theme-color-level($color, $table-border-level)); ^ Wrong number of arguments (3 for 2) for `table-row-variant' in /Users/jasonspick/Projects/Web/FamApp/node_modules/bootstrap/scss/_tables.scss (line 101, column 12) ERROR in src/vendor/libs/hover-dropdown/hover-dropdown.directive.ts(22,5): error TS2740: Type 'Subscription' is missing the following properties from type 'EventEmitter<{}>': __isAsync, emit, subscribe, observers, and 16 more.

here is my package.json:

    {
  "name": "fam-angular",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "node ./ng-add-pug-loader.js"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^8.0.1",
    "@angular/common": "^8.0.1",
    "@angular/compiler": "^8.0.1",
    "@angular/core": "^8.0.1",
    "@angular/forms": "^8.0.1",
    "@angular/http": "^7.1.4",
    "@angular/platform-browser": "^8.0.1",
    "@angular/platform-browser-dynamic": "^8.0.1",
    "@angular/router": "^8.0.1",
    "@auth0/angular-jwt": "^2.1.0",
    "@ng-bootstrap/ng-bootstrap": "4.0.1",
    "@ng-select/ng-select": "^2.13.3",
    "@ngx-translate/core": "^11.0.1",
    "@reactivex/rxjs": "^5.5.12",
    "@swimlane/ngx-datatable": "^13.1.0",
    "angular-calendar": "~0.25.2",
    "angular2-ladda": "^2.0.0",
    "bootstrap": "^4.1.3",
    "chart.js": "^2.7.3",
    "core-js": "^2.6.1",
    "ng-autosize": "~1.1.0",
    "ng-bootstrap": "^1.6.3",
    "ng-cli-pug-loader": "^0.2.0",
    "ng2-archwizard": "~2.1.0",
    "ng2-charts": "^2.0.0-beta.21",
    "ng2-nouislider": "~1.7.7",
    "ngx-chips": "~1.9.1",
    "ngx-dropzone-wrapper": "~6.1.0",
    "ngx-mask": "^6.5.18",
    "ngx-perfect-scrollbar": "~6.2.0",
    "ngx-swiper-wrapper": "~6.2.1",
    "ngx-toastr": "^9.1.1",
    "node-sass": "^4.12.0",
    "plyr": "~2.0.18",
    "quill": "~1.3.6",
    "rxjs": "^6.5.2",
    "spinkit": "~1.2.5",
    "update": "^0.7.4",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.800.3",
    "@angular/cli": "^8.0.3",
    "@angular/compiler-cli": "^8.0.1",
    "@angular/language-service": "^8.0.1",
    "@types/jasmine": "^2.8.14",
    "@types/jasminewd2": "^2.0.6",
    "@types/node": "^8.10.39",
    "apply-loader": "^2.0.0",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.2",
    "pug": "^2.0.3",
    "pug-loader": "^2.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "3.4.5"
  }
}

I am not seeing anything out there for this. Has anyone ran into this during update?

Thanks!

like image 559
Jason Spick Avatar asked Jun 17 '19 23:06

Jason Spick


1 Answers

Ok so I figured it out in my case: I was upgrading an old project to use up-to-date libraries, and this is one of the errors that popped up. The problem was that my project was @importing bootstrap scss files individually, like this:

@import 'node_modules/bootstrap/scss/root';
@import 'node_modules/bootstrap/scss/print';
@import 'node_modules/bootstrap/scss/reboot';
[...]

The problem went away when I replaced all those @imports with the single one (which in turn imports all the correct files for the current bootstrap version):

@import 'node_modules/bootstrap/scss/bootstrap';

Hope this helps someone, there's almost no information about this error on the web.

like image 199
Gabriel Magana Avatar answered Oct 28 '22 19:10

Gabriel Magana