CodeSandbox 502 "Dev Server Has Not Started Yet" Error
Quick answer
The 502 appears when a VM Sandbox preview is opened but the dev server task inside the VM is not running. Open the sandbox in the editor and start or restart the dev server task.
Most likely fix: Start or restart the dev server task
How to fix it
Try these in order — the most common fix is first.
1. Start or restart the dev server task
- Open the VM Sandbox in the CodeSandbox editor
- Open the tasks panel and confirm the dev server task is running
- Start or restart the task and wait for the preview to reconnect
- If you only have the preview link, forward these steps to the sandbox author
Did this fix it?2. Check that the workspace still has credits
- Open your workspace billing or usage page
- If credits are used up, the VM is frozen: upgrade or raise the spending limit, or wait for the next cycle
Did this fix it?
Symptoms
The preview shows a 502 page saying "It looks like the dev server has not started yet".
Why it happens
- The dev server task inside the VM Sandbox is stopped or crashed
- The VM is frozen because credits ran out
- Someone is viewing the preview link without access to the editor
This guide also covers
- codesandbox 502 dev server has not started
- codesandbox preview not working
- codesandbox dev server not started
Still not working?
If CodeSandbox keeps failing, you're not alone. See every CodeSandbox problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
All not loading, error messages & connection guides →
StackBlitz "Cannot load native addon because loading addons is disabled" (StackBlitz)
Codespace Running in Recovery Mode: "This codespace is currently running in recovery mode due to a container error" (GitHub Codespaces)
Replit Workspace Not Loading (Replit)
Ona AWS Runner Failed: ROLLBACK_COMPLETE and ECS Circuit Breaker Errors (Gitpod)
Other CodeSandbox errors
- CodeSandbox Not Loading or Not Starting
- CodeSandbox VM Frozen: Credits Ran Out
- CodeSandbox Preview Not Showing for Private Sandbox
- CodeSandbox "Request Entity Too Large" Error on Import or Commit
- CodeSandbox "Only a Max of 250 Modules Is Allowed" Import Error
- CodeSandbox "Could Not Find Dependency" Error
- CodeSandbox VM Slow or Out of Memory
- CodeSandbox Private Sandboxes on the Free Plan