DEV Community

Tyler Smith
Tyler Smith

Posted on • Edited on

1

How to Open a CodeSandbox Project Without a Browser Preview

From time to time, we all write really bad code. Sometimes, that code is a poorly-written JavaScript loop that completely locks the main thread and prevents anything else from working in that browser tab. If you're working in a standalone text editor, this isn't a big deal: you kill the browser tab, fix your code, then reopen the browser tab to see if your code works.

However, if you're using CodeSandbox, your code is execute in the same tab as the editor. This can make it impossible to fix the bug that's locking the main thread. Thankfully, CodeSandbox has an undocumented way of getting around this.

If you append &runonclick=1 to the end of a project's URL, it will prevent the code preview from running until you click into the preview window. This will allow you to fix your buggy code before it locks up the main thread.

At the time of writing this post, there is no way to do this through the UI.

Thank you to garethx for posting this solution to a GitHub issue!

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay