pbakaus/impeccable · error
Created ${zipFileName} but it is 0 bytes.
Error message
Created ${zipFileName} but it is 0 bytes. What it means
Thrown by createProviderZip() when the written zip file is 0 bytes despite archiver reporting entries. This is the regression guard for silent archiver failures (specifically the archiver v8 ESM break that produced a 0-byte universal.zip without throwing). It runs after the entry-count check passes.
Source
Thrown at scripts/lib/zip.js:56
output.on('error', reject);
archive.on('error', reject);
archive.on('entry', () => { entryCount += 1; });
archive.pipe(output);
archive.glob('**/*', {
cwd: providerDir,
dot: true,
ignore: ['**/.DS_Store'],
});
archive.finalize();
});
if (entryCount === 0) {
throw new Error(`Created ${zipFileName} but it contains no entries (source: ${providerDir}).`);
}
const { size } = statSync(zipPath);
if (size === 0) {
throw new Error(`Created ${zipFileName} but it is 0 bytes.`);
}
const sizeMB = (size / 1024 / 1024).toFixed(2);
console.log(` 📦 ${zipFileName} (${sizeMB} MB)`);
}
/**
* Create ZIP files for all providers + universal
* @param {string} distDir - Path to dist directory
*/
export async function createAllZips(distDir) {
console.log('\n📦 Creating ZIP bundles...');
await createProviderZip(path.join(distDir, 'universal'), distDir, 'universal');
}
View on GitHub (pinned to d14711ae3d)
Solutions
- Check available disk space and write permissions on distDir.
- Pin or upgrade archiver to a known-good version (the comment cites v8's ESM break).
- Reproduce with a minimal script; if archiver is the cause, file/upgrade the dependency.
Example fix
// before — archiver v8 ESM regression writes 0 bytes silently // after — pin a known-good archiver and let the guard fail loud // package.json "archiver": "^7.0.1"
Defensive patterns
Strategy: validation
Validate before calling
import { statSync } from 'node:fs';
const size = statSync(zipPath).size;
if (size === 0) {
throw new Error('archiver produced 0 bytes; pin a known-good archiver version.');
} Type guard
function zipNonEmpty(zipPath) {
return existsSync(zipPath) && statSync(zipPath).size > 0;
} Try / catch
try {
await createProviderZip(providerDir, distDir, providerName);
} catch (err) {
if (/0 bytes/.test(err.message)) {
console.error('archiver regression or disk issue; check archiver version and disk space.');
} else throw err;
} Prevention
- Pin archiver to a known-good version; test the ESM import shape on upgrades.
- Check disk space and write permissions before the release zip step.
- Keep the 0-byte guard; it exists precisely to catch silent archiver failures.
When it happens
Trigger: archiver.finalize() resolves and entryCount > 0 but the output stream wrote nothing to disk — archiver internal failure, a disk-full condition, an interrupted stream, or a bundler/ESM interop bug in archiver itself.
Common situations: A new archiver major version with an ESM/CJS interop regression; disk exhaustion during the write; a stream pipe setup error after a refactor of createProviderZip.
Related errors
- Created ${zipFileName} but it contains no entries (source: $
- Cannot create ${zipFileName}: provider directory not found:
- puppeteer is required for URL scanning. Install: npm install
- extension/manifest.json: expected background.service_worker
- Could not extract browser antipattern registry
AI-assisted analysis of pbakaus/impeccable@d14711ae3d (2026-08-13).
Data as JSON: /api/errors/3d8e8ef61b8dddad.
Report an issue: GitHub.