question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

With modified deploy-url, inlining critical css not working for downloaded roboto font

See original GitHub issue

🐞 With modified deploy-url, inlining critical css not working for downloaded roboto font

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?

No.

In v12 also, was not working.

Description

A clear and concise description of the problem...

🔬 Minimal Reproduction

With modified deploy-url, inlining critical css not working for downloaded roboto font

package.json

"scripts": {
    ...
    "build": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --base-href=/portal/ --deploy-url=/portal/public/ --configuration production"
    ...
}

font.css

@font-face {
  font-family: 'Roboto';
  src: url('Roboto-Light.woff2') format('woff2'),
  url('Roboto-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

angular.json projects.<project-name>.architect.build:

...
"styles": [
             ...
              "src/assets/fonts/font.css",
             ...
],
...
"configurations": {
    "production": {
        ....
        "optimization": {
                        "scripts": true,
                        "styles": {
                          "minify": true,
                          "inlineCritical": true
                        }
                      }
        ....
    }
...
}

🔥 Exception or Error

image

the path is http://localhost:8080/portal/Roboto-Light.86fc2559ff73eac5.woff2 instead of http://localhost:8080/portal/public/Roboto-Light.86fc2559ff73eac5.woff2

🌍 Your Environment

13.0.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19

github_iconTop GitHub Comments

2reactions
mpalourdiocommented, Nov 22, 2021

@alan-agius4 @school-coder I think I have made it work as desired too (The interceptor is indeed really needed, and injecting the APP_BASE_HREF was a good idea!), thanks both for your valuable feedback.

I suspect this will pop again and again on this tracker once deployUrl is removed, because devs are lazy by design, and a deprecation warning is something our eyes ignore until the feature is definitely removed 😃

Once again, thanks ! And keep-up the good work angular team, you do an awesome job!

1reaction
alan-agius4commented, Nov 22, 2021

The CSP issue is a known limitation which is being tracked here: https://github.com/angular/angular-cli/issues/20864

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix problem with Roboto font load in Google Chrome?
The code constructed in this way is to load the fonts at the same time as the page renders, the last code cell...
Read more >
Angular Application In Custom Url Path With Serviceworker - ADocLib
With modified deployurl inlining critical css not working for downloaded roboto font comp: #12322 by naveedahmed1 was closed on Aug 10 2021.
Read more >
Untitled
Highschool dxd barakiel, Tiziano ferro perdona download, Tamir tadilat izle! ... Store app not working windows 8.1, Strong electroweak matter, ...
Read more >
Cree Una Aplicación Sin Servidor De Tres Niveles - Morioh
A diferencia de la aplicación CDK v1, no necesita instalar ningún paquete ... Cree un nuevo directorio llamado web en lib y agregue...
Read more >
material-theme | lightweight jekyll blog theme | Theme library
Implement material-theme with how-to, Q&A, fixes, code snippets. kandi ratings - Low support, 6 Bugs, No Vulnerabilities. Permissive License, Build not ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found