microsoft/typescript-go · error · Error

${publishedTypeScriptAliasPackageName} does not depend on ${

Error message

${publishedTypeScriptAliasPackageName} does not depend on ${npmPackageName}.

What it means

getPublishedPlatformPackageLibDir fetches the lib/ directory of a published platform package (e.g. @typescript/native-preview-win32-x64) by reading its version from the installed alias's `optionalDependencies`. If that map has no entry for the requested npmPackageName, there is no version to download and the build cannot assemble the VSIX, so it throws. The names come from the `platforms` table mapped through getPlatforms().

Source

Thrown at Herebyfile.mjs:2269

/**
 * @param {string} npmPackageName
 */
async function getPublishedPlatformPackageLibDirWorker(npmPackageName) {
    const dest = path.join(builtPublishedPlatformPackages, "node_modules", ...npmPackageName.split("/"));
    const lib = path.join(dest, "lib");
    if (fs.existsSync(lib)) {
        return lib;
    }

    await fs.promises.mkdir(dest, { recursive: true });

    const tarballDestination = path.join(builtPublishedPlatformPackages, "tarballs");
    await fs.promises.mkdir(tarballDestination, { recursive: true });

    const version = getPublishedTypeScriptPackageJson().optionalDependencies[npmPackageName];
    if (!version || typeof version !== "string") {
        throw new Error(`${publishedTypeScriptAliasPackageName} does not depend on ${npmPackageName}.`);
    }

    const lockEntry = getPackageLock().packages[`node_modules/${npmPackageName}`];
    if (!lockEntry) {
        throw new Error(`package-lock.json does not contain ${npmPackageName}; run npm install.`);
    }
    if (lockEntry.version !== version) {
        throw new Error(`package-lock.json has ${npmPackageName}@${lockEntry.version}, but ${publishedTypeScriptAliasPackageName} depends on ${version}.`);
    }
    if (!lockEntry.resolved || typeof lockEntry.resolved !== "string") {
        throw new Error(`package-lock.json entry for ${npmPackageName}@${version} does not contain a tarball URL.`);
    }

    console.log(`Fetching ${npmPackageName}@${version} with npm.`);
    const { stdout } = await $pipe({ cwd: tarballDestination, env: releasePackageEnv })`npm pack --json ${npmPackageName}@${version}`;
    const [packed] = JSON.parse(stdout);
    if (!packed.filename || typeof packed.filename !== "string") {
        throw new Error(`npm pack ${npmPackageName}@${version} did not return a filename.`);

View on GitHub (pinned to 1bcfa18d79)

Solutions

  1. Update the installed alias: `npm install` at repo root so @typescript/bundled-typescript matches the release version whose optionalDependencies include the platform
  2. Inspect `_extension/node_modules/@typescript/bundled-typescript/package.json` optionalDependencies and confirm the exact package name being requested appears there
  3. If the platform is intentionally unsupported for published-package VSIXes, mark it `vsix: false` in the platforms table so it is not requested
Defensive patterns

Strategy: validation

Validate before calling

const optional = require("@typescript/bundled-typescript/package.json").optionalDependencies ?? {};
for (const { npmPackageName } of getPlatforms()) {
  if (typeof optional[npmPackageName] !== "string") {
    throw new Error(`Alias does not list ${npmPackageName} — update/reinstall the alias or drop the platform`);
  }
}

Prevention

When it happens

Trigger: The Herebyfile `platforms` array lists a platform (or a renamed package under publishAsTypescript naming) that the installed `@typescript/bundled-typescript` alias's optionalDependencies does not contain — typically an alias older than the current platforms table, or a package-name mapping change.

Common situations: A new platform was added to Herebyfile.mjs but the local alias predates it; the alias install is stale relative to the branch; the published alias for that version genuinely lacks the platform entry.

Related errors


AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16). Data as JSON: /api/errors/66b6979e7d8eda0e. Report an issue: GitHub.