garrytan/gstack · error · Error

Failed to decode blob data

Error message

Failed to decode blob data

What it means

Error "Failed to decode blob data" thrown in garrytan/gstack.

Source

Thrown at browse/src/write-commands.ts:1207

            const resp = await fetch(blobUrl);
            const blob = await resp.blob();
            if (blob.size > 100 * 1024 * 1024) return 'ERROR:TOO_LARGE';
            return new Promise<string>((resolve, reject) => {
              const reader = new FileReader();
              reader.onloadend = () => resolve(reader.result as string);
              reader.onerror = () => reject('Failed to read blob');
              reader.readAsDataURL(blob);
            });
          } catch (err: any) {
            return `ERROR:EXPIRED:${err?.message || 'unknown'}`;
          }
        }, url);

        if (dataUrl === 'ERROR:TOO_LARGE') throw new Error('Blob too large (>100MB). Use a different approach.');
        if (dataUrl.startsWith('ERROR:EXPIRED')) throw new Error(`Blob URL expired or inaccessible: ${dataUrl.slice('ERROR:EXPIRED:'.length)}`);

        const match = dataUrl.match(/^data:([^;]+);base64,(.+)$/);
        if (!match) throw new Error('Failed to decode blob data');
        contentType = match[1];
        buffer = Buffer.from(match[2], 'base64');
      } else if (useNavigate) {
        // Strategy 2: Navigate to URL and capture browser-triggered download.
        // Handles URLs that trigger file downloads via redirects,
        // Content-Disposition headers, or anti-bot CDN chains where
        // page.request.fetch() can't follow the auth/redirect chain.
        await validateNavigationUrl(url);
        const downloadPromise = page.waitForEvent('download', { timeout: 60000 });
        // Use goto with 'commit' wait — the page may redirect to trigger
        // the download, so 'domcontentloaded' may never fire.
        page.goto(url, { waitUntil: 'commit', timeout: 30000 }).catch(() => {
          // Navigation may "fail" because the response is a download,
          // not a page. The download event handles it.
        });
        const download = await downloadPromise;
        const failure = await download.failure();
        if (failure) {

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at browse/src/write-commands.ts:1207 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12). Data as JSON: /api/errors/4afdfaaaa8a04137. Report an issue: GitHub.