sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Svelte template seems to be broken or outdated

Open moklick opened this issue 1 year ago • 1 comments

Bug report

Packages affected

  • [x] sandpack-react

Description of the problem

When I use template="svelte", it breaks when I use standard svelte functions like setContext.

What were you doing when the problem occurred?

I tried to use a svelte library with sandpack.

What steps can we take to reproduce the problem?

  1. go to https://sandpack.codesandbox.io/docs/getting-started/usage#templates
  2. click "Open Sandbox"
  3. Add this to App.svelte:
  import { setContext } from "svelte";
  setContext("something", true);

example: https://codesandbox.io/s/young-tdd-drp7cw?file=/App.svelte:9-81 the same code works, when used within official codesandbox svelte template: https://codesandbox.io/s/zealous-pare-49zvtx?file=/App.svelte:9-82

Link to sandbox: link

Your Environment

Software Name/Version
Sandpack-react version 2.6.9
Browser Chrome 114.0.5735.133
Operating System MacOs

moklick avatar Jun 28 '23 15:06 moklick

Seems to be a known codesandbox bug codesandbox/codesandbox-client#7417

moklick avatar Jun 29 '23 14:06 moklick