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.

Request interception causes web fonts pending forever

See original GitHub issue

Steps to reproduce

  • Puppeteer version: 5.5.0
  • Platform / OS version: Windows 10, Ubuntu 18, MacOS Big Sur
  • URLs (if applicable):
  • Node.js version: 12.19.0

What steps will reproduce the problem?

Example Script: https://github.com/mstr-pezhang/puppeteer-issue/blob/36cddcc721ec0cf228f213f72dce2addcd5e223d/test/webfont.spec.ts

  1. Create a font-face like https://github.com/mstr-pezhang/puppeteer-issue/blob/36cddcc721ec0cf228f213f72dce2addcd5e223d/static/global.css
  2. In the webpage, do not directly use the web font, but generate a DOM node to use it. https://github.com/mstr-pezhang/puppeteer-issue/blob/36cddcc721ec0cf228f213f72dce2addcd5e223d/static/add-text.js
  3. Enable request interception. For each request, simply call request.continue();.
  4. Open DevTools and go to Network tab.
  5. See that the font cannot be correctly rendered because the URL is pending forever.

What is the expected result? The web font can be successfully loaded and rendered.

What happens instead? The default system font is used instead, while the web font is pending forever. https://github.com/mstr-pezhang/puppeteer-issue/actions/runs/443832997

I’m not sure if it is a Chromium issue, but there are similar issues like #4208 and #5003

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
slawikocommented, Dec 22, 2021

@benallfree probably that could help:

I had similar issue with Font request pending for more than 30sec (I had timeout 35s). After upgrade on 13.0.0 this issue is completely gone

1reaction
dobesvcommented, Jul 2, 2021

In our project we are setting request interception on as right after calling newPage() and before opening any pages but we are still having this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

623616 - DevTools: [network] unused webfonts are shown ...
I verified that the problem occurs even when we have the appropriate fonts exist on the server. ... Steps to reproduce: (1) Connect...
Read more >
Chrome fonts always pending - css
We have about 30 fonts that are pending, mostly from Google but many from our own CDN. This is only occurring in Chrome...
Read more >
A proposal for creating an API to register and enqueue web fonts
Most APIs provide CSS for their webfonts. Registering a webfont in this manner is easy as we can simply call wp_enqueue_webfont( $handle, $url...
Read more >
chrome requests get stuck pending [closed] - nginx
If it's stuck waiting for the end of the content, it means the web server fully received and processed the request, you should...
Read more >
How to Fix Slow Page Loading Waiting for fonts.googleapis ...
Frustrated with slow web page loading with Google Fonts? ... This is the reason for the page getting stuck up in a browser...
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