question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot build library including math.div in SCSS

See original GitHub issue

Type of Issue

[ x] Bug Report
[ ] Feature Request

Description

I recently started trying to build a library of mine with ng-packagr. The problem is that my project heavily depends on divisions within my scss files, which as per latest sass recommendation I do with math.div instead of /.

Once I try to build my library I get the following error: Invalid CSS after " @return math": expected expression (e.g. 1px, bold), was "math.div

I suspect this is related to having a sass peer dependency older than 1.33.0.

How To Reproduce

Add a math.div in your library SCSS

Expected Behaviour

Library builds normally.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: 13.2.0
@angular/*: 13.1.2
typescript: 4.5.4
rxjs: 7.5.2
node: 14.18.0
npm: 6.14.15

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alan-agius4commented, Jan 28, 2022

@angular-devkit/build-ng-packagr:build is no longer supported. Please use the ng-packagr builder in @angular-devkit/build-angular.

@angular-devkit/build-angular:ng-packagr

It is also unclear why you only have the sass version in @angular-devkit/build-angular listed when you run npm ls sass .

0reactions
github-actions[bot]commented, Mar 10, 2022

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sass math.div function is undefined in angular app, but is ...
The SCSS code with math.div works fine in the library. If I put the SCSS code in projects/my-lib/src/lib/my-lib.
Read more >
Breaking Change: Slash as Division - Sass
Users should switch all division to use math.div() instead. 💡 Fun fact: Remember, you can silence deprecation warnings from libraries you don't control!...
Read more >
Cant use sass math.div? - support - HUGO
I get this error when compiling bootstrap docs, i used math.div in my code in detriment of standard sass / operator. Error: Error...
Read more >
SASS Tutorial (build your own CSS library) #7 - Using Math
Hey Gang, in this SASS tutorial we'll see how to use math to calculate CSS property values.🐱‍👤 Get the full SASS course now...
Read more >
Dart SCSS Compatibility [#3278216] | Drupal.org
The new way of using division will be by importing the "sass:math" library and the code would look like this: $x: math.div(10, 2);...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found