sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

Issues when Sandpack times out after initial error

Open andrico1234 opened this issue 1 year ago • 0 comments

Bug report

Here's a Loom showing the issue: https://www.loom.com/share/a25be0d744c54974bc08d65e041b9f08

Here's a simple repro case showing this problem: https://github.com/andrico1234/sandpack-react-repro

Packages affected

  • [x] sandpack-client
  • [x] sandpack-react

Description of the problem

It looks like there are a few problems at play here:

  1. If Sandpack times out while loading and the error overlay is displayed, there's no way for the user to know that Sandpack is disconnected. As a result any further changes that the user makes will not cause the preview to update with the new changes
  2. The "restart" sandpack button doesn't work. If the loading times out and the Sandpack disconnects, triggering a restart just causes a blank screen.

Steps to reproduce:

  1. Create a Sandpack in such a way that there's a compilation error before the first load
  2. Wait for Sandpack loading time out (~45 seconds)
  3. Move/Hide the error overlay (don't remove it from the DOM otherwise it will cause a different error)
  4. Click "restart sandpack"
  5. Observe the broken state

What were you doing when the problem occurred?

What steps can we take to reproduce the problem?

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Sandpack-client version 2.11.2
Sandpack-react version 2.11.2
Browser Arc
Operating System MacOS

andrico1234 avatar Jan 17 '24 11:01 andrico1234