-
Notifications
You must be signed in to change notification settings - Fork 12k
Module build failed: Error: Can't resolve '~https://fonts.googleapis.com/icon?family=Material+Icons' 1.6.4+ #9181
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
Comments
Duplicate of #9166 |
Removing '~' from import resolve the problem, I will let this open just wondering if some one could explain why this happen only with 1.6.4+. |
I’m actually surprised that worked before. The tilde is a webpack specific symbol that means the url is a module. In this case it’s an absolute url and not a module. |
@clydin In many tutorial of how to use material2 theming they said to add that line to the global stylesheet and it was working:
Also @import '~@angular/material/prebuilt-themes/indigo-pink.css'; generate the same error. |
The actual module import for material is indeed a bug. However, the tilde can be removed there as well. The next patch release will address that issue. Material now has official documentation available here: https://material.angular.io/guide/getting-started Also, adding the font urls via imports will have performance implications on your application. The browser will not be aware that it needs to fetch the assets until it parses the stylesheet. Which can cause a delay of first render. Adding them to |
@clydin Thanks for your accurate explanations. |
I replaced the line: @import '~https://fonts.googleapis.com/icon?family=Material+Icons'; By: @font-face { .material-icons { In file styles.css |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Uh oh!
There was an error while loading. Please reload this page.
Versions
Repro steps
npm run build
Observed behavior
Desired behavior
build success :-)
Mention any other details that might be useful (optional)
I have this line in my styles.css file:
The text was updated successfully, but these errors were encountered: