github/copilot-sdk · error

at is empty.

Error message

${label} at ${path} is empty.

What it means

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.

Solutions

  1. Delete the platform package's prebuilds directory and reinstall to re-download artifacts.
  2. Re-run downloadCopilotPackage / npm install with network issues resolved (check proxy/VPN).
  3. Verify disk space and quota on the install volume.
  4. Confirm no build step or bundler is stripping/zeroing binary assets.

Example fix

// before
stat runtime.node -> 0 bytes

// after
rm -rf node_modules/@github/copilot-*/prebuilds
npm install
Defensive patterns

Strategy: validation

Validate before calling

import { statSync } from 'fs';
if (statSync(path).size === 0) throw new Error(`${label} is empty at ${path}; reinstall`);

Try / catch

try {
  const wrapper = getBundledRuntimePath();
} catch (e) {
  if (e.message.includes('is empty')) {
    // repair: wipe prebuilds and reinstall
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Interrupted npm install or network failure during downloadCopilotPackage, filesystem quota issues, proxy writing empty bodies, docker layer cache with truncated files.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09). Data as JSON: /api/errors/0ed9615cdb880ffa. Report an issue: GitHub.

Appendix: source

Thrown at nodejs/src/runtimeArtifacts.ts:71

    "package.json",
    "pvrecorder",
    "queries",
    "README.md",
    "sea-loader.js",
    "webview",
]);

interface RuntimeAsset {
    source: string;
    relativePath: string;
}

export function validateFile(path: string, label: string): void {
    if (!existsSync(path)) {
        throw new Error(`${label} not found at ${path}.`);
    }
    if (statSync(path).size === 0) {
        throw new Error(`${label} at ${path} is empty.`);
    }
}

function validateRuntimeBundle(wrapper: string, runtimeNode: string): void {
    validateFile(wrapper, "Copilot runtime wrapper");
    validateFile(runtimeNode, "Copilot runtime.node");
}

function isExcluded(relativePath: string): boolean {
    const parts = relativePath.split(sep);
    const topLevel = parts[0];
    const fileName = parts.at(-1) ?? "";
    return (
        EXCLUDED_TOP_LEVEL.has(topLevel) ||
        /^tree-sitter.*\.wasm$/.test(topLevel) ||
        /^voice-.*\.js$/.test(topLevel) ||
        fileName === "cli-native.node" ||
        parts.includes("mediaremote-adapter") ||

View on GitHub (pinned to cd8cf15dc3)