sandpack
sandpack copied to clipboard
Sandpack-react Client inside a webview within VS Code extension does not render
Bug report
Packages affected
- [ ] sandpack-client
- [x] sandpack-react
Description of the problem
When I try to load a sandpack-react client within a vscode extension webview, it does not render. I get the following error,
Uncaught TypeError: Cannot read properties of null (reading 'cssRules')
The interesting bit is when I try to load the webview as a standard react application then everything works just perfect. It is only when I try to run it within an extension then it reports the error
What were you doing when the problem occurred?
I am basically creating a custom vscode extension, that would have a webview component for executing custom node js scripts.
What steps can we take to reproduce the problem?
- Grab the 'hello-world' application from https://github.com/microsoft/vscode-webview-ui-toolkit-samples
- install the sandpack-react package in webview folder and reference in App.tsx
- Launch the extension
Link to sandbox: link (optional)
Your Environment
| Software | Name/Version |
|---|---|
| Sandpack-client version | |
| Sandpack-react version | 2.6.7 |
| Browser | chrome |
| Operating System | macOS Big Slur, 11.6.5 |