{"record":{"id":"ffff785d7f8eacf5","repo":"pbakaus/impeccable","slug":"created-zipfilename-but-it-contains-no-entries","errorCode":null,"errorMessage":"Created ${zipFileName} but it contains no entries (source: ${providerDir}).","messagePattern":"Created (.+?) but it contains no entries \\(source: (.+?)\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/zip.js","lineNumber":52,"sourceCode":"    const output = createWriteStream(zipPath);\n    const archive = new ZipArchive({ zlib: { level: 9 } });\n\n    output.on('close', resolve);\n    output.on('error', reject);\n    archive.on('error', reject);\n    archive.on('entry', () => { entryCount += 1; });\n\n    archive.pipe(output);\n    archive.glob('**/*', {\n      cwd: providerDir,\n      dot: true,\n      ignore: ['**/.DS_Store'],\n    });\n    archive.finalize();\n  });\n\n  if (entryCount === 0) {\n    throw new Error(`Created ${zipFileName} but it contains no entries (source: ${providerDir}).`);\n  }\n  const { size } = statSync(zipPath);\n  if (size === 0) {\n    throw new Error(`Created ${zipFileName} but it is 0 bytes.`);\n  }\n\n  const sizeMB = (size / 1024 / 1024).toFixed(2);\n  console.log(`  📦 ${zipFileName} (${sizeMB} MB)`);\n}\n\n/**\n * Create ZIP files for all providers + universal\n * @param {string} distDir - Path to dist directory\n */\nexport async function createAllZips(distDir) {\n  console.log('\\n📦 Creating ZIP bundles...');\n\n  await createProviderZip(path.join(distDir, 'universal'), distDir, 'universal');","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/scripts/lib/zip.js#L34-L70","documentation":"Thrown by createProviderZip() when the archive was finalized but archiver emitted zero 'entry' events — i.e. the provider directory existed but the glob '**/*' matched nothing (after ignoring .DS_Store). Added as a loud guard after archiver v8's ESM break once silently shipped a 0-byte universal.zip.","triggerScenarios":"providerDir exists but is empty, or contains only ignored files (e.g. only .DS_Store); the glob pattern was overridden to exclude everything; archiver.glob silently matched nothing because cwd resolved to an empty dir.","commonSituations":"A provider stage created the directory but failed to copy any files into it; a build step that writes provider output conditionally and skipped this provider; an over-aggressive ignore list.","solutions":["Inspect providerDir contents (`ls -la`) and confirm real files were staged into it.","Fix the upstream provider stage so it writes its SKILL.md / scripts into the directory before zipping.","If the ignore list was customized, ensure it still permits the provider's files through."],"exampleFix":"// before — universal dir created but empty\nfs.mkdirSync(path.join(distDir, 'universal'), { recursive: true });\nawait createProviderZip(path.join(distDir, 'universal'), distDir, 'universal');\n\n// after — actually stage files into it\nfs.cpSync(skillSrcDir, path.join(distDir, 'universal'), { recursive: true });\nawait createProviderZip(path.join(distDir, 'universal'), distDir, 'universal');","handlingStrategy":"validation","validationCode":"import { readdirSync } from 'node:fs';\nconst real = readdirSync(providerDir, { withFileTypes: true })\n  .filter(e => !e.name.endsWith('.DS_Store'));\nif (real.length === 0) {\n  throw new Error(`Provider dir ${providerDir} has no real files to zip.`);\n}","typeGuard":"function providerDirHasFiles(providerDir) {\n  return readdirSync(providerDir, { withFileTypes: true })\n    .some(e => !e.name.endsWith('.DS_Store'));\n}","tryCatchPattern":"try {\n  await createProviderZip(providerDir, distDir, providerName);\n} catch (err) {\n  if (/no entries/.test(err.message)) {\n    console.error('Provider dir empty; fix the upstream stage:', providerDir);\n  } else throw err;\n}","preventionTips":["After staging a provider, assert files were written before zipping.","Treat an empty provider dir as a build failure, not a skip.","Log the staged file count per provider in CI."],"tags":["build","zip","empty-archive","provider","release","regression-guard"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}