Skip to content

Suspicious irregularity when --prod building font name with spaces #11679

@wulfsberg

Description

@wulfsberg

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Win 10, Node 8.11.1, npm 6.2.0
@angular-devkit/architect 0.7.1
@angular-devkit/build-angular 0.7.1
@angular-devkit/build-optimizer 0.7.1
@angular-devkit/build-webpack 0.7.1
@angular-devkit/core 0.7.1
@angular-devkit/schematics 0.7.1
@angular/cdk 6.4.1
@angular/cli 6.1.1
@angular/material 6.4.1
@ngtools/webpack 6.1.1
@schematics/angular 0.7.1
@schematics/update 0.7.1
rxjs 6.2.2
typescript 2.9.2
webpack 4.9.2

Repro steps

Setting up custom typography for Angular Material with a font name with spaces, as in
https://stackblitz.com/edit/space-in-font-name?file=src%2Fstyles.scss
(The actual error cannot be seen there, as StackBlitz does not use ng build optimization)

ng build --prod or ng serve --prod

The log given by the failure

WARNING in Invalid font values at 1087:2. Ignoring.
WARNING in Invalid font values at 1000:2. Ignoring.

Desired functionality

Clean build without warnings. When the "Invalid font values" are reported, it usually means the font is not being applied somewhere, so this likely means a (two?) Material component(s) will not be styled correctly.

Mention any other details that might be useful

The warning does not appear when using a font name without spaces (with or without quotes), nor when not using the --prod flag.

Given the relation to the --prod build optimizations, I have logged it against Angular CLI, as it looks suspiciously like some quotemarks are being lost during build, but I am unsure how to trace it further. It could potentially also be some "dirty" source code in the Material project triggering the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions