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 is not fully working #35835
Comments
I am also experiencing the same issue. This problem started after upgrading my project to React 18.0.0. |
Same issue, after upgraded to React 18 external fonts doesn't work after |
Related: #24781 (comment) |
@balazsorban44 My |
Hi, @balazsorban44. I'm having the same situation as @firatciftci. So, it is may not be because |
Yep, and I've just noticed one thing. Fonts doesn't work when the page includes |
From a fresh install and copying exactly what is suggested in the Font Optimization docs. The After some research on https://css-tricks.com/really-dislike-fout-font-display-optional-might-jam/
I ended up switching the |
@ronsj I have <link
href="https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet"
/> I am not sure how to best achieve setting up |
Temporary fix: Then it won't change href to data-href. |
1. react@18 下 font-optimization 有 BUG, Temporary fix: optimizeFonts: false; vercel/next.js#35835 (comment) 2. next@12.1.5 swcMinify 有 BUG, 12.1.4 还是好的, Temporary fix: swcMinify: false; vercel/next.js#36127 (comment) 3. 当前 next@12.1.5 和 @sentry/nextjs@6.19.6 的情况有 BUG, 不会上传 sourcemap 不知道以前是否是好; getsentry/sentry-javascript#3579 (comment)
1. react@18 下 font-optimization 有 BUG, Temporary fix: optimizeFonts: false; vercel/next.js#35835 (comment) 2. next@12.1.5 swcMinify 有 BUG, 12.1.4 还是好的, Temporary fix: swcMinify: false; vercel/next.js#36127 (comment) 3. 当前 next@12.1.5 和 @sentry/nextjs@6.19.6 的情况有 BUG, 新发现仅仅 Windows 有问题, 不会上传 sourcemap 不知道以前是否是好; getsentry/sentry-javascript#3579 (comment)
Seems like next.js/packages/next/server/render.tsx Line 1310 in 4fb0beb
we always have generateStaticHTML as false. Hence the processors never work for ssr: There were some commits 3 months ago regarding this. Not sure if that is what make SSR stop working. I change the code manually to start as TRUE, and the web optimizations started working again. |
@shuding Do you know if this has sth to do with your refactoring? Can you help us, please ?
|
Follow up for #35888 to re-enable more test, and re-enable post processors after #36792 has better support for document.gIP with react 18. Apply post-pocessing when the the shell chunk is fully buffered. re-enabled integration tests for react 18: - amphtml - amphtml-custom-optimizer - app-document - font-optimization Fixes #35835 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
Hi, the fix is landed in |
Hi @huozhi I can confirm that this issue has been resolved in Thanks |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Chrome 100.0.4896.60
How are you deploying your application? (if relevant)
Vercel, Heroku
Describe the Bug
Font Optimization is not working fully.
This happened after upgrading to React@18.
I have set up the project and using _document.tsx would like to add some of Google Fonts.
This is what it looks like in _document.tsx.
This is what it should look like after deployment.
However, this is what it looks currently like after deployment.
The
href
is turned todata-href
after font optimization. But,link
is not turned tostyle
.Expected Behavior
Font Optimization should work.
To Reproduce
Since it appears in individual projects, it is normal in most cases. So it's hard to reproduce. I tried, but I can't reproduce it by creating a new project.
The text was updated successfully, but these errors were encountered: