Angular-cli: ng build works but emits a warning

Created on 26 Feb 2018  路  7Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 1.7.1
Node: 6.9.5
OS: win32 x64
Angular: 5.2.6

@angular/cli: 1.7.1
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.1
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.4.2
webpack-bundle-analyzer: 2.11.0
webpack: 3.11.0

Repro steps

  • ng build --prod --base-href ./

Observed behavior

ng build works as expected but emit this warning and it break my css:

WARNING in Invalid character(s) ';
' at 324:2. Ignoring.

Desired behavior

No warning and no breaking

Mention any other details that might be useful (optional)

Where can I find this character at 324:2?

low confusing bufix

Most helpful comment

in my case it was background: ""; in a third-party css.
I changed it to background: transparent; and I have no warnings now.

All 7 comments

I found the problem, was a ; lost in one of various css that I have, would be nice if this error appeared more clearly and still in ng serve.

This is not a bug, can be closed.

I have a similar issue, how can I find the offending value? In my case it's an 'Invalid background value at 5609:18'. I've combed through the css / scss files and corrected all my background values yet the warning persists...
Thanks

My workaroung until find the offending value was to prod with ng build --extract-css=false.

in my case it was background: ""; in a third-party css.
I changed it to background: transparent; and I have no warnings now.

I have a similar issue, how can I find the offending value? In my case it's an 'Invalid background value at 5609:18'. I've combed through the css / scss files and corrected all my background values yet the warning persists...
Thanks

Same issue with me, did you already fixed it?

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NCC1701M picture NCC1701M  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

hartjo picture hartjo  路  3Comments

naveedahmed1 picture naveedahmed1  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments