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.

Building with @angular/material v13 @use statements are failing

See original GitHub issue

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

After updating to v13 this morning, which removed all of the tildes from material’s @use statements, our library isn’t building, saying it can’t find the stylesheet. If I add the tildes back, it builds fine. Using without the tilde is working ok in the context of an application, but ng-packagr seems to still need them. This causes a really ugly catch 22, since our styles can’t have tildes to work with applications, but need them to work with the library build.

Error

------------------------------------------------------------------------------
Building entry point '@fabric/components/breadcrumbs'
------------------------------------------------------------------------------
× Compiling with Angular sources in Ivy partial compilation mode.
Can't find stylesheet to import.
  ╷
7 │ @use '@angular/material' as mat;
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  breadcrumbs\breadcrumbs.component.scss 7:1  root stylesheet
error Command failed with exit code 1.

Version Information

ng-packagr: 13.0.0
@angular/*: 13.0.0
typescript: 4.4.4
rxjs: 7.4.0
node: 14.17.0
yarn: 1.22.15

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
alan-agius4commented, Nov 5, 2021

Yeah, you are right. Let me do that.

1reaction
michaelfaithcommented, Nov 4, 2021

@alan-agius4 Thanks for the quick turnaround!

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular 13 ng build library fails (ivy partial compilation mode)
This solution appears to be for an Angular app. I'm trying to build a library. · 2. This is why i wrote "if...
Read more >
Deprecated APIs and features - Angular
Use non-factory based framework APIs. v13, Since Ivy, Component factories are not required. Angular provides other APIs where Component classes can be used ......
Read more >
Angular 13 in Depth - Sébastien Dubois
With this release, Angular now uses the persistent build cache by ... With Angular 13, the accessibility of Angular Material MDC-based ...
Read more >
Troubleshooting | jest-preset-angular - GitHub Pages
To patch it for Angular Material, use this workaround. ... SyntaxError: Cannot use import statement outside a module ... Coverage fail but tests...
Read more >
Build a Beautiful App + Login with Angular Material
In this tutorial, I'll show you how to create a login form like the one above. You'll create an Angular app, use Material...
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