Repository navigation
fix(docs): unblock prerender by closing Image JSX without blank lines - #48465
Conversation
MDX treats a blank line inside JSX as the end of the element, which corrupts the tree and crashes prerender with a children TypeError. Also stop forwarding accidental Image children to next/image.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe ChangesImage component and documentation integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Braintrust eval report
|
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Docs production builds can fail during prerender with:
TypeError: Cannot read properties of undefined (reading 'children')Seen on
/guides/ai/going-to-prod(and the same pattern exists on several other guides).Root cause: blank lines inside MDX JSX such as
<Image ...>make the MDX parser treat the element as closed early, which corrupts the AST. Separately,apps/docs/components/Image.tsxforwarded accidentalchildren(and could overwritesrc) ontonext/image.What is the new behavior?
/>on the affected guide MDX files so the JSX stays one element.Imagewrapper dropchildrenand keepsrcfrom props only, so a bad MDX tree is less likely to crash the build.Additional context
Split out of #48428 so that PR stays focused on Admonition/Alert typography.
To test
apps/docs), or wait for the Vercel docs preview on this PR.childrencrash:Imagewrapper change).Summary by CodeRabbit
New Features
Bug Fixes