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

@charset "UTF-8"; not lifted to the top of the css file when @import url() used #19246

Closed
1 of 15 tasks
SLKnutson opened this issue Oct 28, 2020 · 2 comments
Closed
1 of 15 tasks

Comments

@SLKnutson
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Maybe.

Description

@charset "UTF-8"; not lifted to the top of the css file when @import url() used. Instead, all the @import url()s are listed first.

As far as how this affects the user, it seems like chrome is still able to figure things out, most of the time. One way to force it to mess up due to this is to load the app, open dev tools, and then reload the app. That is probably a separate chrome bug.

🔬 Minimal Reproduction

Here is a repo that exhibits the problem. Note the second commit that changes 2 files to make this happen:
https://github.com/SLKnutson/angular-bug
Run ng build --configuration="production" and then look at the dist/styles.css file.
Charset needs to be the first line in the file, but it is not.

🌍 Your Environment

Found in mac and linux, haven't tried Windows

Anything else relevant?
If node-sass is used, this problem doesn't occur because node-sass doesn't change the '\f103' into a unicode character, and so no @charset "UTF-8"; is needed.

When optimization=true in angular.json, the error is fixed.

I've done a little bit of digging, the css looks good coming out of the actual sass compiler, but gets messed up somewhere after that.

Thanks!

@alan-agius4
Copy link
Collaborator

I'm sorry, but this issue is not caused by Angular CLI. Please contact the author(s) of the css-loader project or file an issue on their issue tracker.

@angular-automatic-lock-bot
Copy link

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

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants