From 14c7231982a872ece932db9c2cc129a78e5d06fb Mon Sep 17 00:00:00 2001 From: NikPnevmatikos <61566326+NikPnevmatikos@users.noreply.github.com> Date: Fri, 11 Sep 2026 17:11:08 +0300 Subject: [PATCH] fix(website): pass Snack dependencies un-encoded so the embed resolves 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 --- website/src/components/SnackEmbed.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/website/src/components/SnackEmbed.tsx b/website/src/components/SnackEmbed.tsx index 2dda24e..82ea35d 100644 --- a/website/src/components/SnackEmbed.tsx +++ b/website/src/components/SnackEmbed.tsx @@ -16,16 +16,17 @@ const FILES = encodeURIComponent( }), ); -const DEPENDENCIES = encodeURIComponent( - [ - '@nikpnevmatikos/html-renderer', - '@nikpnevmatikos/html-renderer-video', - // Deep imports must be listed as their own dependency for Snack to resolve them. - '@nikpnevmatikos/html-renderer-video/expo', - 'expo-video', - 'expo-status-bar', - ].join(','), -); +// Not URL-encoded on purpose: embed.js decodes `data-snack-files` before +// posting it to the iframe but forwards `data-snack-dependencies` verbatim, +// and Snack does not decode it on arrival. +const DEPENDENCIES = [ + '@nikpnevmatikos/html-renderer', + '@nikpnevmatikos/html-renderer-video', + // Deep imports must be listed as their own dependency for Snack to resolve them. + '@nikpnevmatikos/html-renderer-video/expo', + 'expo-video', + 'expo-status-bar', +].join(','); // expo-video is only bundled into Snack's runtime from SDK 56 onwards. const SDK_VERSION = '56.0.0';