sandpack
sandpack copied to clipboard
Svelte template seems to be broken or outdated
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?
- go to https://sandpack.codesandbox.io/docs/getting-started/usage#templates
- click "Open Sandbox"
- 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 |
Seems to be a known codesandbox bug codesandbox/codesandbox-client#7417