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 - style tag for custom fonts is included on pages without a link to a font provider #23896

Closed
arekbartnik opened this issue Apr 11, 2021 · 2 comments · Fixed by #24162
Assignees
Labels
bug Issue was opened via the bug report template.

Comments

@arekbartnik
Copy link

What version of Next.js are you using?

10.1.4-canary.3

What version of Node.js are you using?

14.15

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

next start, Vercel

Describe the Bug

I've two pages - one with a link tag to a custom font (https://nextjs-fonts-optimization-bug.vercel.app/with-font) and one without custom font (https://nextjs-fonts-optimization-bug.vercel.app/without-font).

When I start on the page with a custom font then a style tag is included in all pages until I'll restart the server.

I think this behaviour appears only when using getServerSideProps - I couldn't reproduce the bug consistently without it.

Expected Behavior

The generated style tag should be included only for pages with a link tag to a custom font.

To Reproduce

https://nextjs-fonts-optimization-bug.vercel.app/with-font
https://nextjs-fonts-optimization-bug.vercel.app/without-font

repo: https://github.com/ArekBartnik/nextjs-fonts-optimization-bug

@arekbartnik arekbartnik added the bug Issue was opened via the bug report template. label Apr 11, 2021
@arekbartnik arekbartnik changed the title Font optimization - style for custom fonts in included on pages without link to font provider Font optimization - style tag for custom fonts is included on pages without a link to a font provider Apr 11, 2021
@janicklas-ralph janicklas-ralph self-assigned this Apr 13, 2021
@janicklas-ralph
Copy link
Contributor

Thanks for reporting this. I will have a look into the issue.

janicklas-ralph added a commit to janicklas-ralph/next.js that referenced this issue Apr 16, 2021
@ijjk ijjk mentioned this issue Apr 17, 2021
2 tasks
@kodiakhq kodiakhq bot closed this as completed in #24162 Apr 26, 2021
kodiakhq bot pushed a commit that referenced this issue Apr 26, 2021
## Bug

- [x] Related issues linked using `fixes #23896`
- [x] Integration tests added

Fixes #23896
@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
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants