Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find style '@angular/material' #108

Open
palarnab opened this issue Feb 18, 2022 · 7 comments
Open

Cannot find style '@angular/material' #108

palarnab opened this issue Feb 18, 2022 · 7 comments

Comments

@palarnab
Copy link

palarnab commented Feb 18, 2022

Describe the bug
In Angular 13 having the '~' sign before "@use" fails the build. On removing ~ from '@angular/material' fails scss-bundle with the following error:

There is an error in your styles:
[20:11:16] erro: ╷
[20:11:16] erro: 3 │ @use '@angular/material' as mat;

This fix is needed to continue to use scss-bundle in @angular^13

To Reproduce
use scss-bundle to build any file (with a mixin) having the line as the first line:

@use '@angular/material' as mat;

image

Expected behavior
scss-bundle should complete the bundle successfully

Package version: "scss-bundle": "^3.1.2",
Node version: v12.x
OS: Windows

@Ostabo
Copy link

Ostabo commented Mar 22, 2022

#90

@andreevsm
Copy link

Yeah, the same problem for me 😢

@pelord
Copy link

pelord commented Jul 12, 2022

Hi there, I get the same problem

@pelord
Copy link

pelord commented Jul 12, 2022

@palarnab Did you find a solution?

@palarnab
Copy link
Author

Sorry for the late reply... but eventually I did not find a solution from scss-bundle.. I had to clean the generated scss like this:

var fs = require('fs');
fs.readFile('genfile.scss', 'utf8', function (err, data) {
    if (err) throw err;    
    var newFile = data.replace('~@angular/material', '@angular/material');
    fs.writeFile('newfile.scss', newFile, 'utf-8', function (err) {
      if (err) throw err;
      console.log('...scss fixed (https://github.com/reactway/scss-bundle/issues/108)');
    });
});

@pelord
Copy link

pelord commented Jul 19, 2022

Thanks! I will probably do the same.

@ceoaliongroo
Copy link
Contributor

Maybe you used scss-bundle like us to export scss assets from a Angular Library to Angular Applications.

If that the case yo can check the Angular Team Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants