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

Font Optimization produces empty font definitions #19159

Closed
lukevmorris opened this issue Nov 13, 2020 · 2 comments · Fixed by #19758
Closed

Font Optimization produces empty font definitions #19159

lukevmorris opened this issue Nov 13, 2020 · 2 comments · Fixed by #19758
Milestone

Comments

@lukevmorris
Copy link

lukevmorris commented Nov 13, 2020

Bug report

Describe the bug

I've enabled experimental font optimization in next.config.js, but it does not work quite as described in the PR that introduced it.

To Reproduce

  1. Build and start a production server from my minimal repo:
git clone https://github.com/lukevmorris/font-optimization
cd font-optimization
npm install
npm run build
npm run start
  1. Open http://localhost:3000/
  2. Inspect the <head> of the document
  3. Inspect the built .next/server/font-manifest.json file

Expected behavior

The tag is transformed as expected

  • link href property is replaced with data-href of the same value
  • style tag is created with the same data-href key/value
  • style tag contains an inlined font definition

The .next/server/font-manifest.json contains font definitions as fetched from https://fonts.googleapis.com/css...

Actual behavior

The style tag exists but is empty:

<head>
  ...
  <link rel="stylesheet" data-href="https://fonts.googleapis.com/css?family=Voces">
  ...
  <style data-href="https://fonts.googleapis.com/css?family=Voces"></style>
  ...
</head>

Also the font-manifest.json file exists but contains just an empty array:

[]

System information

  • OS: macOS
  • Browser: Firefox
  • Version of Next.js: 10.0.1
  • Version of Node.js: 14.15.0
@lukevmorris lukevmorris added the bug Issue was opened via the bug report template. label Nov 13, 2020
@timneutkens timneutkens added kind: bug and removed bug Issue was opened via the bug report template. labels Nov 16, 2020
@kodiakhq kodiakhq bot closed this as completed in #19758 Dec 4, 2020
kodiakhq bot pushed a commit that referenced this issue Dec 4, 2020
- Making font optimizations as default
- Re-enabling tests
- Fixes #19159
@Timer Timer added this to the iteration 14 milestone Dec 4, 2020
@marianocodes
Copy link

marianocodes commented Jan 8, 2021

Did this get fixed? I still see the font-manifest.json empty. Next 10.0.5v

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants