{"record":{"id":"05a520d2fa387d76","repo":"microsoft/typescript-go","slug":"native-preview-release-requires-forrelease-and","errorCode":null,"errorMessage":"native-preview:release requires --forRelease and --setPrerelease flags, unless nativePreviewReleaseVersion is hardcoded and VSIX production is disabled. Example: npx hereby native-preview:release --forRelease --setPrerelease=dev.1.0","messagePattern":"native-preview:release requires --forRelease and --setPrerelease flags, unless nativePreviewReleaseVersion is hardcoded and VSIX production is disabled\\. Example: npx hereby native-preview:release --forRelease --setPrerelease=dev\\.1\\.0","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":2397,"sourceCode":"    }\r\n\r\n    await sign({\r\n        SignFileRecordList: [\r\n            {\r\n                SignFileList: extensions.map(({ vsixSignaturePath }) => ({ SrcPath: vsixSignaturePath, DstPath: null })),\r\n                Certs: \"VSCodePublisher\",\r\n                MacAppName: undefined,\r\n            },\r\n        ],\r\n    });\r\n}\r\n\r\nexport const nativePreviewRelease = task({\r\n    name: \"native-preview:release\",\r\n    hiddenFromTaskList: true,\r\n    run: async () => {\r\n        if (!options.forRelease || !options.setPrerelease && (!nativePreviewReleaseVersion || produceAnyVsix)) {\r\n            throw new Error(\"native-preview:release requires --forRelease and --setPrerelease flags, unless nativePreviewReleaseVersion is hardcoded and VSIX production is disabled. Example: npx hereby native-preview:release --forRelease --setPrerelease=dev.1.0\");\r\n        }\r\n        await runBuildNativePreviewPackages();\r\n        await runSignNativePreviewPackages();\r\n        await runPackNativePreviewPackages();\r\n        await runPackVsixExtensions();\r\n        await runSignVsixExtensions();\r\n        await runCleanSignTempDirectory();\r\n    },\r\n});\r\n\r\nexport const nativePreview = task({\r\n    name: \"native-preview\",\r\n    hiddenFromTaskList: true,\r\n    dependencies: options.forRelease ? undefined : [packNativePreviewPackages, packVsixExtensions],\r\n    run: options.forRelease ? async () => {\r\n        throw new Error(\"This task should not be run in release builds.\");\r\n    } : undefined,\r\n});\r","sourceCodeStart":2379,"sourceCodeEnd":2415,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L2379-L2415","documentation":"The `native-preview:release` task validates its invocation up front: it requires --forRelease, and also requires --setPrerelease unless `nativePreviewReleaseVersion` is hardcoded in Herebyfile.mjs AND VSIX production is disabled (produceAnyVsix false). Every sub-step it chains (sign packages, pack packages, pack/sign VSIXes) assumes those flags, so an invalid invocation fails fast with an example command rather than mid-pipeline.","triggerScenarios":"Running `npx hereby native-preview:release` with no flags; or with --forRelease but no --setPrerelease while nativePreviewReleaseVersion is not hardcoded or any VSIX production (produceNativePreviewVsix / produceTypeScriptNightlyVsix) is enabled.","commonSituations":"Copy-pasting the task name without flags; CI scripts that set --forRelease but compute the prerelease variable to empty; a release engineer assuming the hardcoded-version path works while VSIX production is on.","solutions":["Run with both flags: `npx hereby native-preview:release --forRelease --setPrerelease=dev.1.0`","If you intended the hardcoded-version path, ensure nativePreviewReleaseVersion is set in Herebyfile.mjs and VSIX production is disabled, then omit --setPrerelease","Audit CI scripts to always pass --forRelease and a correctly-formatted --setPrerelease (dev.N.M)"],"exampleFix":"# before\nnpx hereby native-preview:release\n\n# after\nnpx hereby native-preview:release --forRelease --setPrerelease=dev.1.0","handlingStrategy":"validation","validationCode":"function validateReleaseInvocation({ forRelease, setPrerelease, nativePreviewReleaseVersion, produceAnyVsix }) {\n  if (!forRelease || (!setPrerelease && (!nativePreviewReleaseVersion || produceAnyVsix))) {\n    throw new Error(\"Use: npx hereby native-preview:release --forRelease --setPrerelease=dev.N.M\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap hereby release invocations in a script that validates flags first","If using the hardcoded-version path, confirm VSIX production is disabled in the same change"],"tags":["release","hereby","build","vsix"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}