WebContainer use a combination of service workers in multiple domains to work. If you have blocked third-party cookies in your browser settings, this might prevent those service workers from registering correctly.
If you observe any odd behavior when running StackBlitz projects (like a command that hangs forever, or a web preview that never shows up), check if your browser is indeed blocking cookies:
If that is the case, you need to "Allow" cookies for those third-party domains. After that, the browser will prompt you to reload the page and you will be able to run the current project.
Note that the list of blocked domains might look different for you. In particular, a
xyz.local.webcontainer.io domain might not be present. WebContainer projects use different domains dynamically, depending on what the runtime is doing (e.g. whether it is serving HTTP content or not), so you might need to check the list of blocked domains later if you see something off again. Alternatively, you can follow the procedure below to unblock all StackBlitz projects.
Note that each project is associated with one or more unique WebContainer domains (
node-rmoswo.stackblitz.io in the screenshot, for instance). That means that you would need to repeat the process above for every project you open. Instead, you can configure the exceptions to be more general.
First, find the list of configured exceptions to your blocking policy (in Chrome, you can go to chrome://settings/cookies):
Instead of the specific, per-project exceptions, create a new one or edit the existing ones:
The more general patterns that will allow StackBlitz to work are: