sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Sandpack-react Client inside a webview within VS Code extension does not render

Open vishagar81 opened this issue 2 years ago • 0 comments

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?

  1. Grab the 'hello-world' application from https://github.com/microsoft/vscode-webview-ui-toolkit-samples
  2. install the sandpack-react package in webview folder and reference in App.tsx
  3. 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

vishagar81 avatar Jun 07 '23 08:06 vishagar81