Skip to main content

Cookie Blockers

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:

Screenshot of the site settings menu of a browser, showing an entry for cookie management

Screenshot of the site settings menu of a browser, showing an entry for cookie management

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.

Allowing 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):

Screenshot of the privacy settings menu of Google Chrome, showing allowed 3rd party cookies

Instead of the specific, per-project exceptions, create a new one or edit the existing ones:

Screenshot of the privacy settings menu of Google Chrome, showing the Edit option for a blocking exception of a domain

The more general patterns that will allow StackBlitz to work are:

https://[*.]stackblitz.io:443https://[*.]local.webcontainer.io:443

Screenshot of the privacy settings menu of Google Chrome, showing allowed 3rd party cookies for all StackBlitz subdomains