-
Notifications
You must be signed in to change notification settings - Fork 12k
Postcss warnings with ~ font paths relative to node_modules after upgrading from 1.5.0 to 1.6.0 #8781
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
We also had this warning when upgrading to Angular CLI 1.6.0 today. A workaround we found is making the path include node_modules because it tries to resolve the path relative to the src folder So this becomes this
|
The use of the tilde is webpack specific and while this should work for the foreseeable future, it may not always. The suggested change provided by @jozlnr may therefore be prudent. |
Moving the files to your |
I can confirm the relative paths works. All warnings are gone. What puzzles me though is the angular CLI recognizes |
With the way the sass-loader and webpack work, the top level (referenced in So what @paesku recommended would work in this situation and would definitely be a cleaner option here as the font path wouldn't need to be set. However, if any other scss variables needed to be set before the import than that wouldn't be an option. |
@jozlnr @clydin The workaround works only for simpler cases: as you changes to a relative path, if the file containing the variable definition is imported elsewhere in the project, it breaks with errors. In my case it's defined in Like this:
If you have ideas... |
I received this today too. Downgraded to cli 1.5.5 and updated my package.json, which sorted the problem. I have a vast selection of scss files using includes and paths using ~, so using relative paths causes me more problems - doesn't seem to solve the issues for me either way. Won't be upgrading until these warnings go away - can't discern real errors / warnings from this nonsense. |
The workaround suggested by @jozlnr doesn't seem to work in more complex scenarios like a main styles.scss setting variables and importing bootstrap-sass. |
Still broken in 1.6.3 ...here is where it is reproduced Steps to reproduce: |
Still broken. Check #8791 |
@yogeshgadge This issue has to do with a @sinedied from the error output it appears that the imported file is defining a font. So for each component with that imported file, the font is being defined and setup again. It may be cleaner to do font setup once in the global stylesheet (unless the font is only ever used in one component). |
There is no tilde in the font url.
…On Tue, Jan 2, 2018, 12:50 PM clydin ***@***.***> wrote:
@yogeshgadge <https://github.com/yogeshgadge> This issue has to do with a
url() containing a tilde not an import. Either way, it is generally not
recommended to use a tilde if possible as it is webpack specific.
@sinedied <https://github.com/sinedied> from the error output it appears
that the imported file is defining a font. So for each component with that
imported file, the font is being defined and setup again. It may be cleaner
to do font setup once in the global stylesheet (unless the font is only
ever used in one component).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8781 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACT7OPnZsWif0Xk3GhY0du55ZtQB0_bzks5tGmx5gaJpZM4Q5WKM>
.
|
Still not fixed in 1.6.3... |
1.6.3 fixed this issue for me |
I'm still getting warnings on 1.6.3 |
I'm getting this because of an path in an Variable definitionen: Version 1.5.3 was OK For version 1.6.3 I must change this to: Please reopen the issue and review this, so tilde is working again. |
On Windows, the build now breaks completely, due to improper paths, the errors go like this (followed by many similar ones):
Seems like the paths were not concatenated in a portable way by |
For |
This issue should really be reopened @clydin:
Most likely the fix have issues on Windows. |
1.6.3 still produces this error for me on Win 8.1. Currently doing some work converting my site to use SSR and tried to upgrade the cli:
Downgraded to 1.5.5 again and it works fine:
|
I ran into the same error when including a custom font that had spaces in the filename: |
Having this same issue with @angular/cli 1.6.8 on Debian GNU/Linux (testing) |
I am using Angular Universal mode in my project.When i run the project with normal mode ,everthing is right,no error with "src: url('/src/assets/font/BrandonText-Light.otf') format('opentype');". but when trying to run with server side rendering mode ,it doesn't see fonts. |
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. |
Versions
Repro steps
In order to load font-awesome fonts, I am using the method described in #1463. In styles.css, I have added:
Observed behavior
Since upgrading to angular-cli 1.6.0 I am getting warnings from postcss-url that the font files used by font-awesome cannot be found:
I am getting this error for all 4 types of fonts that font-awesome uses (.eot/.ttf/.woff/woff2).
I assume this is postcss trying to inline etc. and then not finding the files due to the ~ in the path. From what I can see, postcss-url not finding the files does not seem to affect the build result, they get required and loaded just fine.
Desired behavior
No warnings :)
The text was updated successfully, but these errors were encountered: