Codesandbox-client: Add the ability to kill or disconnect the preview

Created on 17 Feb 2020  路  5Comments  路  Source: codesandbox/codesandbox-client

馃寛 Feature


I'd like the ability to kill or disconnect the preview app from the editor. The problem is, right now if you are writing code that does things inside a loop, for example, requestAnimationFrame loops, and you have an error inside that loop, codesandbox crashes completely and the app is perhaps unrecoverable because you cannot save or edit. The whole thing totally freezes.


I think the feature should work by adding a "toggle preview update" button or something to the preview view which, if toggled off, kills the preview app process completely and frees up the editor for changes


I think a button like I mentioned would be good. The current way to go into preferences doesn't work because the sandbox is totally frozen/broken.

All 5 comments

You can add runonclick=1 argument to the sandbox's URL, e.g. https://codesandbox.io/s/lr21yjkvv7?runonclick=1, allowing you to stop the preview while you fix up your code.

Oh wow that鈥檚 a great tip, thanks!

Still, this would be good as a UI feature, maybe even just a button that refreshes the page but adds that query string as a stop gap.

@garethx There's no way to do it while working in PWA mode

@garethx Your tip just saved me, thank you!

I'd love if there was a way to do this from the Dashboard. Maybe an option for "Open Without Preview" when you click the three dots for extra options when opening the project.

Due to inactivity, I'm closing this issue. If you can provide us the required info, we will investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kenyk7 picture kenyk7  路  22Comments

ryanpcmcquen picture ryanpcmcquen  路  23Comments

Nico-L picture Nico-L  路  21Comments

CompuIves picture CompuIves  路  26Comments

Telokis picture Telokis  路  24Comments