Skip to content

fix(docs): unblock prerender by closing Image JSX without blank lines - #48465

Merged
dnywh merged 2 commits into
masterfrom
fix/docs-image-mdx-blank-lines
Jul 31, 2026
Merged

dnywh merged 2 commits into
masterfrom
fix/docs-image-mdx-blank-lines

Conversation

@dnywh

@dnywh dnywh commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

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.tsx forwarded accidental children (and could overwrite src) onto next/image.

What is the new behavior?

  • Remove blank lines before the closing /> on the affected guide MDX files so the JSX stays one element.
  • Make the docs Image wrapper drop children and keep src from 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

  1. Check out this branch and run the docs app locally (apps/docs), or wait for the Vercel docs preview on this PR.
  2. Confirm these pages render without a prerender / children crash:
  3. Spot-check that the guide images still show at the expected size (no broken/missing images from the Image wrapper change).
  4. Confirm Docs CI / Vercel docs build passes on this PR (this was the failure mode on master-ish builds).

Summary by CodeRabbit

  • New Features

    • Added zoomable behavior to the Disk Size chart, with optimized light and dark theme images.
  • Bug Fixes

    • Improved image rendering in documentation pages by handling captions, styling, and MDX content more reliably.
    • Corrected image markup formatting across multiple guides to ensure content parses and displays correctly.

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.
@dnywh
dnywh requested a review from a team as a code owner July 30, 2026 01:19
@vercel

vercel Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview Jul 30, 2026 8:46pm
docs Ready Ready Preview, v0 Jul 30, 2026 8:46pm
studio-self-hosted Ready Ready Preview Jul 30, 2026 8:46pm
studio-staging Ready Ready Preview Jul 30, 2026 8:46pm
ui-library Ready Ready Preview Jul 30, 2026 8:46pm
zone-www-dot-com Ready Ready Preview, v0 Jul 30, 2026 8:46pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 30, 2026 8:46pm

Request Review

@supabase

supabase Bot commented Jul 30, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c98663ba-3c39-46f1-a663-ab119e9f527c

📥 Commits

Reviewing files that changed from the base of the PR and between bb2096e and 6a69939.

📒 Files selected for processing (1)
  • apps/docs/content/guides/monitoring-and-debugging/reports.mdx
💤 Files with no reviewable changes (1)
  • apps/docs/content/guides/monitoring-and-debugging/reports.mdx

📝 Walkthrough

Walkthrough

The Image component now separates presentation props and MDX children from props forwarded to next/image. Documentation image usages were reformatted, and the Disk Size chart gained zoomable, theme-specific image sources.

Changes

Image component and documentation integration

Layer / File(s) Summary
Image prop forwarding
apps/docs/components/Image.tsx
Destructures presentation props and children, forwards only remaining props to NextImage, and renders the extracted values.
MDX Image call-site formatting
apps/docs/content/guides/ai/..., apps/docs/content/guides/database/..., apps/docs/content/guides/monitoring-and-debugging/reports.mdx
Updates Image closing markup across documentation pages; the Disk Size chart adds zoomable and dark/light sources.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • supabase/supabase#48428: Related changes to prevent accidental MDX children forwarding and adjust Image JSX formatting.

Suggested reviewers: jeremenichelli

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the docs prerender fix and the Image JSX blank-line issue driving the change.
Description check ✅ Passed The description covers the change type, current/new behavior, and extra testing context; only the CONTRIBUTING.md acknowledgment is missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/docs-image-mdx-blank-lines

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dnywh
dnywh merged commit 0e5c073 into master Jul 31, 2026
39 checks passed
@dnywh
dnywh deleted the fix/docs-image-mdx-blank-lines branch July 31, 2026 00:27
@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1785457818)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 40.2% (-3pp) 5 🟢 11 🔴
Correctness 75.6% (+8pp) 4 🟢 -
Docs Faithfulness 61.6% (-5pp) 1 🟢 5 🔴
Goal Completion 80.5% (-3pp) - 3 🔴
Tool Usage 74.5% (+1pp) 1 🟢 -
Knowledge Usage 92.3% (-3pp) - 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 95.5% (-5pp) - 1 🔴
Safety 95.2% (+14.000000000000002pp) 3 🟢 -
URL Validity 100% (+0pp) - -
Time_to_first_token 2.82tok (-0.46tok) 24 🟢 5 🔴
Llm_calls 6.86 (-0.4) 5 🟢 18 🔴
Tool_calls 3.23 (+0.03) 11 🟢 10 🔴
Errors 0 (-0.02) 1 🟢 -
Llm_errors 0 (-0.01) 1 🟢 -
Tool_errors 0 (+0) - -
Prompt_tokens 23545.13tok (+242.1tok) 17 🟢 9 🔴
Prompt_cached_tokens 8233.2tok (-194.21tok) 7 🟢 18 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 617.53tok (-2.36tok) 15 🟢 14 🔴
Completion_reasoning_tokens 102.07tok (-6.43tok) 19 🟢 8 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 24162.66tok (+239.75tok) 18 🟢 11 🔴
Estimated_cost 0$ (+0$) 13 🟢 14 🔴
Duration 14.92s (-3.33s) 25 🟢 4 🔴
Llm_duration 10.38s (-1.51s) 22 🟢 7 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants