Skip to content

fix(website): Snack playground never ran because dependencies were URL-encoded - #14

Merged
NikPnevmatikos merged 1 commit into
mainfrom
docs/website
Sep 11, 2026
Merged

NikPnevmatikos merged 1 commit into
mainfrom
docs/website

Conversation

@NikPnevmatikos

Copy link
Copy Markdown
Owner

Problem

On the live site the embedded Snack loads the example code but never runs it. Snack's embed.js decodes data-snack-files before posting it into the iframe but forwards data-snack-dependencies verbatim, and the Snack app merges that value straight into its query state without decoding. The percent-encoded list (%40nikpnevmatikos%2Fhtml-renderer%2C...) was therefore treated as a single, unresolvable package name.

Fix

Pass the dependencies list un-encoded in website/src/components/SnackEmbed.tsx. The files attribute stays encoded, since embed.js decodes that one.

Verification

  • Rebuilt the site locally; the built landing page now carries data-snack-dependencies=@nikpnevmatikos/html-renderer,@nikpnevmatikos/html-renderer-video,....
  • Served the build and confirmed the embed loads the example code into the Snack editor.
  • Root cause confirmed against embed.js (option parsing) and website/src/client/components/EmbeddedApp.tsx in expo/snack.

The Docs workflow deploys automatically on merge.

🤖 Generated with Claude Code

…s them

embed.js decodes data-snack-files before posting it to the iframe but
forwards data-snack-dependencies verbatim, and Snack merges that value
into its query state without decoding. The percent-encoded list was
therefore treated as one unresolvable package name and the playground
never ran.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@NikPnevmatikos
NikPnevmatikos merged commit 4df5dd1 into main Sep 11, 2026
4 checks passed
@NikPnevmatikos
NikPnevmatikos deleted the docs/website branch September 11, 2026 14:28
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