| name | stackblitz-common-errors |
| description | Fix WebContainer and StackBlitz errors: COOP/COEP, SharedArrayBuffer, boot failures.
Use when WebContainers fail to boot, embeds don't load,
or processes crash inside WebContainers.
Trigger: "stackblitz error", "webcontainer error", "SharedArrayBuffer not defined".
|
| allowed-tools | Read, Grep, Bash(curl:*) |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ide","webcontainers","stackblitz"] |
| compatibility | Designed for Claude Code |
StackBlitz Common Errors
Error Reference
SharedArrayBuffer is not defined
Cause: Missing cross-origin isolation headers.
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Fix: Add both headers to your server. In Vite: server.headers config.
Failed to boot WebContainer
Cause: Only one WebContainer instance allowed per page.
const wc1 = await WebContainer.boot();
const wc2 = await WebContainer.boot();
let instance: WebContainer | null = null;
async function getWC() {
if (!instance) instance = await WebContainer.boot();
return instance;
}
npm install hangs or fails
Cause: Large dependency tree or network issue in WebContainer.
const proc = await wc.spawn('npm', ['install', '--prefer-offline']);
const code = await proc.exit;
if (code !== 0) {
.();
retry = wc.(, []);
retry.;
}