{"record":{"id":"d3e8896b2c1a8473","repo":"microsoft/typescript-go","slug":"usepublishedplatformpackagesforvsix-requires-pub","errorCode":null,"errorMessage":"usePublishedPlatformPackagesForVsix requires ${publishedTypeScriptAliasPackageName}'s installed version (${version}) to match release version ${expectedVersion}.","messagePattern":"usePublishedPlatformPackagesForVsix requires (.+?)'s installed version \\((.+?)\\) to match release version (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":2226,"sourceCode":"            }\r\n            if (!packageJson.version || typeof packageJson.version !== \"string\") {\r\n                throw new Error(`${publishedTypeScriptAliasPackageName} package.json did not contain a version.`);\r\n            }\r\n            if (!packageJson.optionalDependencies || typeof packageJson.optionalDependencies !== \"object\") {\r\n                throw new Error(`${publishedTypeScriptAliasPackageName} package.json did not contain platform optionalDependencies.`);\r\n            }\r\n            return packageJson;\r\n        }\r\n    }\r\n\r\n    throw new Error(`Could not find ${publishedTypeScriptAliasPackageName}; run npm install first.`);\r\n});\r\n\r\nfunction getPublishedTypeScriptVersion() {\r\n    const version = getPublishedTypeScriptPackageJson().version;\r\n    const expectedVersion = getVersion();\r\n    if (usePublishedPlatformPackagesForVsix && version !== expectedVersion) {\r\n        throw new Error(`usePublishedPlatformPackagesForVsix requires ${publishedTypeScriptAliasPackageName}'s installed version (${version}) to match release version ${expectedVersion}.`);\r\n    }\r\n    return version;\r\n}\r\n\r\nfunction checkPublishedPlatformPackagesForVsix() {\r\n    if (!options.forRelease) {\r\n        throw new Error(\"usePublishedPlatformPackagesForVsix requires forRelease\");\r\n    }\r\n    getPublishedTypeScriptVersion();\r\n}\r\n\r\nconst getPackageLock = memoize(() => JSON.parse(fs.readFileSync(path.join(__dirname, \"package-lock.json\"), \"utf8\")));\r\n\r\n/**\r\n * @param {string} npmPackageName\r\n */\r\nasync function getPublishedPlatformPackageLibDir(npmPackageName) {\r\n    let promise = publishedPlatformPackageLibDirs.get(npmPackageName);\r","sourceCodeStart":2208,"sourceCodeEnd":2244,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L2208-L2244","documentation":"getPublishedTypeScriptVersion compares the installed `@typescript/bundled-typescript` version with getVersion() (the release version derived from --setPrerelease/nativePreviewReleaseVersion). When usePublishedPlatformPackagesForVsix is enabled, VSIXes must embed lib/ dirs from exactly the published platform packages matching the release, so a mismatch aborts the build instead of producing a VSIX with mixed-version binaries.","triggerScenarios":"Running VSIX packaging with usePublishedPlatformPackagesForVsix while node_modules still holds an older (or newer) alias than the version hereby computes — e.g. after bumping --setPrerelease or the hardcoded nativePreviewReleaseVersion without reinstalling.","commonSituations":"Version bumped in CI but the install step was skipped or cached with the previous version; switching between release lines; local node_modules stale after pulling version changes.","solutions":["Re-run `npm install` at the repo root so `@typescript/bundled-typescript` resolves to the release version, then retry","If the intended release version is the installed one, fix what you pass: align --setPrerelease (or nativePreviewReleaseVersion) with the installed alias version","In CI, always run install after computing the version, and don't cache node_modules across version bumps"],"exampleFix":"# before (alias installed at dev.24.9, releasing dev.25.0)\nnpx hereby native-preview:release --forRelease --setPrerelease=dev.25.0\n\n# after\nnpm install && npx hereby native-preview:release --forRelease --setPrerelease=dev.25.0","handlingStrategy":"validation","validationCode":"const installed = require(\"@typescript/bundled-typescript/package.json\").version;\nconst expected = computeReleaseVersion(); // same source hereby uses\nif (installed !== expected) {\n  throw new Error(`Alias ${installed} != release ${expected} — run npm install`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In CI, run install after computing the release version, never before","Don't cache node_modules across version bumps"],"tags":["npm","versioning","release","vsix"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}