stackblitz-common-errors

Featured

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".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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. ```typescript // BAD: Multiple boot calls const wc1 = await WebContainer.boot(); const wc2 = await WebContainer.boot(); // Fails! // GOOD: Singleton pattern 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. ```typescript // Use --prefer-offline and minimal deps const proc = await wc.spawn('npm', ['install', '--prefer-offline']); const code = await proc.exit; if (code !== 0) { console.error('Install failed, retrying...'); const retry = await wc.spawn('npm', ['install']); await retry.exit; } ``` ### server-ready event never fires **Cause:** Application not listening on a port. ```typescript // Ensure your app calls listen() // app.listen(3000) -- required for server-ready event // Also check process exit code for crashes wc.on('error', (err) => console.error('WC error:', err)); ``` ### File operations fail with ENOENT **Cause:** Parent directory doesn't exist. ```typescript // Create pare...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category