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
[Bug]: FluentProvider stylesheet (CSS vars for theme) are not server-side rendered #25425
Comments
Hi @paularmstrong-msft, your repro doesn't show the issue. I think it's probably related to this #23620. The fix would be to change your module.exports = {
reactStrictMode: false
}; You can see that the sandbox you provided has StrictMode turned off. Let me know if you still have issues after making the change. Thanks! |
@sopranopillow Set your network inspector to "slow 3g" or turn of javascript in your browser to reproduce the issue. Also, the next.config.js has strict mode disabled: https://codesandbox.io/p/github/paularmstrong-msft/fluentui-ssr-issue/draft/silent-smoke?file=%2Fnext.config.js |
I can confirm that I do see a FOUC briefly in the above repro |
Indeed, However, we need to ensure that it will work with portals. |
I have the same issue, my solution with Next JS 13 is to use |
So, will this be fixed or something? And when will this be fixed? @layershifter |
Any update on this yet? The documentation states: This issue actually makes this statement incorrect, as most components won't be styled correctly with the CSS and HTML served to the client until javascript is loaded. I can't migrate a project (a public website) from v8 to v9 as long as this is the case. |
Yes, the plan is to fix it in one of our upcoming sprints. |
Seems to work like it should, https://codesandbox.io/s/kind-morning-1n281k?file=/src/App.js |
Library
React Components / v9 (@fluentui/react-components)
System Info
Are you reporting Accessibility issue?
no
Reproduction
https://codesandbox.io/p/github/paularmstrong-msft/fluentui-ssr-issue/draft/silent-smoke
Bug Description
Actual Behavior
No theme variables are server-side rendered, causing the site to initially display with no colors, incorrect fonts, incorrect spacing, etc, etc.
Expected Behavior
When following the SSR instructions, it is expected that ALL styles are rendered to the page and do not have a flash of unstyled content (FOUC).
Logs
No response
Requested priority
High
Products/sites affected
No response
Are you willing to submit a PR to fix?
no
Validations
The text was updated successfully, but these errors were encountered: