-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Public site: Get Started buttons html is getting clobbered by main JS #6350
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
Comments
How can I reproduce it? Do I need to switch between two commits? |
It happens for me on |
Never mind, I can reproduce it now... |
This is not a cache problem (because I started fresh), but a hydration issue. Here's the HTML before hydration (with JS disabled): Here's what's after: The You can see for your self with this very simple repro: const $ = require("react").createElement;
const { minify } = require("html-webpack-plugin/node_modules/html-minifier-terser");
function Home() {
return $("p", null, $("div", null));
}
const html = require("react-dom/server").renderToString($(Home, null));
console.log("Raw render:");
console.log(html);
console.log("Minified:");
minify(html).then(console.log);
The solution is to fix the markup because we should write conformant HTML. |
I'm surprised there isn't a lint rule in I found this 3rd party plugin: |
This is quite hard to validate, particularly in this case where it's |
I'm also pretty sure react does log a warning here when it does the rendering. It contains utils that validate the DOM structure iirc. |
Yeah we should add an end-to-end test to make sure no React warnings are logged. #6354 Thanks! |
Suggestion
Continuing #6081: on typescript-eslint.io right now, the Get Started buttons are the wrong size:
Specifically, the server-rendered HTML has the right HTML+CSS, but once the main JS chunk loads in, the button becomes small again. I believe it's from React hydrating with old component JS data.
I poked at things locally (thanks very much again to @AgentEnder for the help!):
rm -rf packages/website/build
...so I believe the conclusion is that there's something wrong with how
build/
outputs are not getting cleaned between Docusaurus rebuilds.@Josh-Cena - do you have any insights here?
The text was updated successfully, but these errors were encountered: