Skip to content

fix(catalog): resolve assets a script loads by name - #3170

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/catalog-script-loaded-assets
Aug 10, 2026
Merged

fix(catalog): resolve assets a script loads by name#3170
miguel-heygen merged 1 commit into
mainfrom
fix/catalog-script-loaded-assets

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Fixes the three 3D catalog previews that render an empty scene in production: vfx-iphone-device, ios26-liquid-glass and macos-tahoe-liquid-glass.

Why

Those blocks load their model with loader.load("models/iphone.glb"). The asset pass only looked at src=, href= and url(), so a name passed to a function was invisible to it and the relative path went into the payload untouched. A srcdoc iframe has no base URL of its own, so it resolved against the docs page and 404'd.

The preview still mounted, still played, and still reported a rendered composition. Only the model was missing, which is why nothing caught it: every DOM-level check passed. It showed as an empty frame stuck at 0:00 / 0:00.

How

Names that resolve to a real file inside the item's own directory now count as references. They are deliberately weaker than markup references: a name that is not a file is ignored rather than failing the item, because an ordinary string that happens to look like a filename must not push an item onto the video fallback. Markup references keep the strict behaviour, so a genuinely missing src= still fails the item.

The models are inlined rather than linked, because .glb is one of the types the docs host does not publish.

Separately, an item now loses its payload when a run decides it cannot build one. Without that, the page generator kept finding the previous run's file on disk and emitted a player for a preview that no longer existed. That is the mechanism that let a stale broken payload reach production instead of falling back to video.

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)

Four new cases in scripts/catalog-payload-assets.test.ts cover a model loaded by name, a lookalike string that is not a file, and that markup references still fail strictly. 24 pass.

Confirmed against production first, by scanning all 164 deployed payloads for paths that resolve to nothing: exactly 2 were affected, matching the two pages reported. Screenshots of both showed an empty frame at 0:00 / 0:00. After the fix all three items embed their model, with no relative paths left in any payload.

Adds ~3 MB, the three models, one copy each.

The 3D blocks fetch their model with loader.load("models/iphone.glb"), which no
attribute or url() pattern can see, so the path survived into the payload
untouched. Inside a srcdoc iframe it resolved against the docs page and 404'd,
leaving vfx-iphone-device and ios26-liquid-glass mounted and playing with an
empty scene.

Names that resolve to a real file in the item's own directory now count as
references. They are deliberately weaker than markup references: a name that is
not a file is ignored rather than failing the item, so an ordinary string that
happens to look like a filename cannot push an item onto the video fallback.

Also clears an item's payload when a run decides it cannot build one, so the
page generator stops finding a previous run's file on disk and emitting a
player for a preview that no longer exists.
@mintlify

mintlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hyperframes 🟡 Building Aug 10, 2026, 10:15 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@miguel-heygen
miguel-heygen merged commit 470f802 into main Aug 10, 2026
32 checks passed
@miguel-heygen
miguel-heygen deleted the fix/catalog-script-loaded-assets branch August 10, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant