{"record":{"id":"0ed9615cdb880ffa","repo":"github/copilot-sdk","slug":"label-at-path-is-empty","errorCode":null,"errorMessage":"${label} at ${path} is empty.","messagePattern":"(.+?) at (.+?) is empty\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/runtimeArtifacts.ts","lineNumber":71,"sourceCode":"    \"package.json\",\n    \"pvrecorder\",\n    \"queries\",\n    \"README.md\",\n    \"sea-loader.js\",\n    \"webview\",\n]);\n\ninterface RuntimeAsset {\n    source: string;\n    relativePath: string;\n}\n\nexport function validateFile(path: string, label: string): void {\n    if (!existsSync(path)) {\n        throw new Error(`${label} not found at ${path}.`);\n    }\n    if (statSync(path).size === 0) {\n        throw new Error(`${label} at ${path} is empty.`);\n    }\n}\n\nfunction validateRuntimeBundle(wrapper: string, runtimeNode: string): void {\n    validateFile(wrapper, \"Copilot runtime wrapper\");\n    validateFile(runtimeNode, \"Copilot runtime.node\");\n}\n\nfunction isExcluded(relativePath: string): boolean {\n    const parts = relativePath.split(sep);\n    const topLevel = parts[0];\n    const fileName = parts.at(-1) ?? \"\";\n    return (\n        EXCLUDED_TOP_LEVEL.has(topLevel) ||\n        /^tree-sitter.*\\.wasm$/.test(topLevel) ||\n        /^voice-.*\\.js$/.test(topLevel) ||\n        fileName === \"cli-native.node\" ||\n        parts.includes(\"mediaremote-adapter\") ||","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/runtimeArtifacts.ts#L53-L89","documentation":"validateFile also rejects artifacts that exist but are zero bytes, throwing '<label> at <path> is empty'. An empty runtime wrapper or runtime.node cannot execute, so the SDK fails fast rather than launching a broken runtime.","triggerScenarios":"statSync(path).size === 0 for the wrapper or runtime.node during validateRuntimeBundle, typically after an interrupted download or a failed extraction left a 0-byte placeholder.","commonSituations":"Interrupted npm install or network failure during downloadCopilotPackage, filesystem quota issues, proxy writing empty bodies, docker layer cache with truncated files.","solutions":["Delete the platform package's prebuilds directory and reinstall to re-download artifacts.","Re-run downloadCopilotPackage / npm install with network issues resolved (check proxy/VPN).","Verify disk space and quota on the install volume.","Confirm no build step or bundler is stripping/zeroing binary assets."],"exampleFix":"// before\nstat runtime.node -> 0 bytes\n\n// after\nrm -rf node_modules/@github/copilot-*/prebuilds\nnpm install","handlingStrategy":"validation","validationCode":"import { statSync } from 'fs';\nif (statSync(path).size === 0) throw new Error(`${label} is empty at ${path}; reinstall`);","typeGuard":null,"tryCatchPattern":"try {\n  const wrapper = getBundledRuntimePath();\n} catch (e) {\n  if (e.message.includes('is empty')) {\n    // repair: wipe prebuilds and reinstall\n  } else throw e;\n}","preventionTips":["Re-download artifacts after any interrupted install.","Check disk space/quota in install environments.","Verify download integrity (proxies can write empty bodies)."],"tags":["filesystem","empty-file","corrupted-install","nodejs"],"backgroundTag":"empty-required-field","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}