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
- Update the installed alias: `npm install` at repo root so @typescript/bundled-typescript matches the release version whose optionalDependencies include the platform
- Inspect `_extension/node_modules/@typescript/bundled-typescript/package.json` optionalDependencies and confirm the exact package name being requested appears there
- 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 adding a platform to Herebyfile.mjs, verify the alias version you build against lists it
- Mark experimental platforms vsix: false until the published alias includes them
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
- ${publishedTypeScriptAliasPackageName} should alias the type
- ${publishedTypeScriptAliasPackageName} package.json did not
- Published platform package ${npmPackageName}@${version} did
- Found external imports in .d.ts files:\n${importErrors.map(e
- ${publishedTypeScriptAliasPackageName} package.json did not
AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16).
Data as JSON: /api/errors/66b6979e7d8eda0e.
Report an issue: GitHub.