Topic: SassError: Undefined function. math.div

ged.admin free asked 3 years ago


Hi,

Note : I use MDB Pro 4 v12.0.0 Since when I compile project MDB updates to the latest version, I have the next Error:

ERROR in ./node_modules/ng-uikit-pro-standard/assets/scss/bootstrap/bootstrap.scss (./node_modules/css-loader/dist/cjs.js??ref--14-1!./node_modules/postcss-loader/src??embedded!./node_modules/resolve-url-loader??ref--14-3!./node_modules/@angular-devkit/build-angular/n ode_modules/sass-loader/dist/cjs.js??ref--14-4!./node_modules/ng-uikit-pro-standard/assets/scss/bootstrap/bootstrap.scss) Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/dist/cjs.js): SassError: Undefined function. ╷ 50 │ $rfs-base-font-size: math.div( │ ┌────────────────────────^ 51 │ │ $rfs-base-font-size, 52 │ │ $rfs-base-font-size * 0 + math.div(1, $rfs-rem-value) 53 │ │ ); │ └───^

I diff the v11 and v12 of MDB pro and difference related to scss is that there updated operations to "math.div". Specifying sass and sass-loader in the package isn't helpful. With MDB Pro 4 v11 - everything was Ok.

Please suggest is it possible to set v11 manually for MDB pro4, or how to resolve the error I faced?

package.json { "name": "canteen-access-management", "version": "1.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --prod", "test": "ng test --watch=false --code-coverage", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^10.0.14", "@angular/cdk": "^9.1.3", "@angular/common": "~10.0.14", "@angular/compiler": "~10.0.14", "@angular/core": "~10.0.14", "@angular/forms": "~10.0.14", "@angular/platform-browser": "~10.0.14", "@angular/platform-browser-dynamic": "~10.0.14", "@angular/router": "~10.0.14", "@fortawesome/fontawesome-free": "^5.15.0", "@types/chart.js": "^2.9.24", "animate.css": "^3.7.2", "chart.js": "^2.5.0", "easy-pie-chart": "^2.1.7", "hammerjs": "^2.0.8", "ng-uikit-pro-standard": "git+https://oauth2:xxxxxxxxxxx@git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git", "ngx-toastr": "^12.0.1", "ngx-webstorage": "^6.0.0", "rxjs": "~6.5.4", "screenfull": "^3.3.0", "tslib": "^2.0.0", "zone.js": "~0.10.3", "components-library": "file:components-library/dist/canteen-components", "sass": "^1.33.0", "sass-loader": "12.1.0" }, "devDependencies": { "@angular-builders/custom-webpack": "^10.0.1", "@angular-devkit/build-angular": "^0.1000.8", "@angular/cli": "~10.0.8", "@angular/compiler-cli": "~10.0.14", "@angular/language-service": "~10.0.14", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.0", "javascript-obfuscator": "^2.9.4", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~3.3.0", "karma-jasmine-html-reporter": "^1.5.0", "karma-junit-reporter": "^2.0.1", "protractor": "~7.0.0", "puppeteer": "^2.1.1", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~3.9.7", "webpack-obfuscator": "3.0.0" } }


Arkadiusz Idzikowski staff answered 3 years ago


@ged.admin MDB4 Angular 12.0.0 requires Angular 12. You need to update your Angular dependencies or downgrade the MDB version.

You can install specific version by adding #version at the end of the installation command:

npm install git+https://oauth2:<your-auth-token>@git.mdbootstrap.com/mdb/angular/ng-uikit-pro-standard.git#11.1.0 --save

ged.admin free commented 3 years ago

@Arkadiusz Idzikowski Thanks!



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB4 11.1.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes
Tags