fix(storybook): drop Pre from MdComponents story to unblock chromatic#18262
Merged
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
wackerow
previously approved these changes
May 22, 2026
8689b79 to
68fc774
Compare
The recent change that routed fenced code through Codeblock made the shared <Pre> wrapper an async server component (Codeblock awaits shiki's highlight()). Chromatic's client-side test runner can't render async server components, which surfaces as a generic "Storybook preview hooks can only be called inside decorators and story functions" error and fails the whole build. Codeblock has its own dedicated story (with chromatic snapshot disabled), so removing the <Pre> demo from MdComponents keeps full visual coverage of every other md element (headings, paragraphs, title, divider, hr, featured text) without duplicating coverage of Codeblock.
68fc774 to
4138475
Compare
Contributor
Lighthouse scores are calculated based on the latest audit results |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
feat(md): render fenced code via Codeblock(ba00561) changed the shared<Pre>wrapper inMdComponentsto render the async server componentCodeblock(itawaits shiki'shighlight()). Chromatic's client-side test runner can't render async server components, so it bubbles up a generic "Storybook preview hooks can only be called inside decorators and story functions" error and fails the entire visual regression build.Since
Codeblockhas its own dedicated story (withchromatic.disableSnapshotset for the same reason), the cleanest fix is to drop the<Pre>demo fromMdComponents.stories.tsx. Every other md element (headings, paragraphs, title, divider, hr, featured text) is still covered visually.Test plan
pnpm type-checkpassespnpm build-storybooksucceeds<Pre>