sandpack
                                
                                 sandpack copied to clipboard
                                
                                    sandpack copied to clipboard
                            
                            
                            
                        Issues when Sandpack times out after initial error
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:
- 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
- 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:
- Create a Sandpack in such a way that there's a compilation error before the first load
- Wait for Sandpack loading time out (~45 seconds)
- Move/Hide the error overlay (don't remove it from the DOM otherwise it will cause a different error)
- Click "restart sandpack"
- 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 |