You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Text that goes through the Markdown component is not in the HTML that gets served.
$ curl -s https://podman.io/features | grep -c "Podman makes it easy to find"
0
That sentence is visible on the page.
Why:src/components/utilities/Markdown/index.tsx wraps ReactMarkdown in BrowserOnly, which renders nothing during the static build. The text only appears after the browser loads it. The component is used in 19 places, including PageHeader and SectionHeader, which are on every custom page.
How much text this is (words in the served HTML):
page
now
if it rendered on the server
/
364
495
/features
414
525
/community
442
944
/get-started
718
826
On /community, 16 of the 28 longer visible lines are missing from the HTML.
It builds fine without the wrapper. Importing react-markdown directly: yarn build passes, no hydration warnings, and the text shows up. The bundle is slightly smaller too, so the lazy import is not buying anything.
Where it came from:#18 (April 2023) hit Suspense breaking the static build, the wrapper landed in 13d0577, and it was never revisited. React 17 does not support Suspense on the server, which is why it broke back then.
Notes:
The BrowserOnly in HeroHeader is a different case, it needs the browser for OS detection. Leaving that one.
Docs and blog pages use Docusaurus MDX, so they are not affected.
Text that goes through the
Markdowncomponent is not in the HTML that gets served.That sentence is visible on the page.
Why:
src/components/utilities/Markdown/index.tsxwraps ReactMarkdown inBrowserOnly, which renders nothing during the static build. The text only appears after the browser loads it. The component is used in 19 places, includingPageHeaderandSectionHeader, which are on every custom page.How much text this is (words in the served HTML):
On /community, 16 of the 28 longer visible lines are missing from the HTML.
It builds fine without the wrapper. Importing react-markdown directly:
yarn buildpasses, no hydration warnings, and the text shows up. The bundle is slightly smaller too, so the lazy import is not buying anything.Where it came from: #18 (April 2023) hit Suspense breaking the static build, the wrapper landed in 13d0577, and it was never revisited. React 17 does not support Suspense on the server, which is why it broke back then.
Notes:
BrowserOnlyinHeroHeaderis a different case, it needs the browser for OS detection. Leaving that one.Happy to send a PR.