Closed mlstubblefield closed 6 months ago
There is no way to inline critical CSS on App router. I can't find any solution to do it now. I don't know why Nextjs not support for App router
@mlstubblefield do you have any solution to solve it now?
Yea, it's a bummer- we saw huuuge improvements in our FCP when we first added critters, so I'm sad to see it no longer function.
Is there any update on this issue?
Edit by maintainers: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
Critters does not support streaming. This experimental flag works in the Pages Router (no streaming) but does not work with the App Router (has streaming). I've updated this issue to be a feature request and converted it to a discussion.
Link to the code that reproduces this issue
https://github.com/mlstubblefield/nextjs-optimize-css
To Reproduce
const nextConfig = { experimental:{ optimizeCss: true } }
Critical CSS is blocking :( and not optimized!![image](https://github.com/vercel/next.js/assets/7562533/be14dd99-0608-474d-a0af-d1e788d37ba5)
Current vs. Expected behavior
Before the appDir, critical css was inlined and FCP would be really really fast. Now, you can see that FCP is behind the blocking CSS!
Just look at this waterfall https://www.webpagetest.org/result/231027_BiDcZF_FDJ/1/details/#waterfall_view_step1
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
No response