{"record":{"id":"736da8b40f710071","repo":"dotnet/runtime","slug":"continuousintegrationbuild-environment-variable-is","errorCode":null,"errorMessage":"ContinuousIntegrationBuild environment variable is not defined","messagePattern":"ContinuousIntegrationBuild environment variable is not defined","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/native/rollup.config.defines.js","lineNumber":9,"sourceCode":"//! Licensed to the .NET Foundation under one or more agreements.\n//! The .NET Foundation licenses this file to you under the MIT license.\n\n/* eslint-disable no-console */\n\nimport gitCommitInfo from \"git-commit-info\";\n\nif (process.env.ContinuousIntegrationBuild === undefined) {\n    throw new Error(\"ContinuousIntegrationBuild environment variable is not defined\");\n}\nif (process.env.Configuration === undefined) {\n    throw new Error(\"Configuration environment variable is not defined\");\n}\nif (process.env.ProductVersion === undefined) {\n    throw new Error(\"ProductVersion environment variable is not defined\");\n}\n\nexport const configuration = process.env.Configuration !== \"Release\" && process.env.Configuration !== \"RELEASE\" ? \"Debug\" : \"Release\";\nexport const runtimeFlavor = process.env.RuntimeFlavor || \"CoreCLR\";\nexport const productVersion = process.env.ProductVersion;\nexport const isContinuousIntegrationBuild = process.env.ContinuousIntegrationBuild === \"true\" ? true : false;\nexport const staticLibDestination = process.env.StaticLibDestination || `../../artifacts/obj/native/net${productVersion}-browser-${configuration}-wasm/lib`;\n\nconsole.log(`Rollup configuration: Configuration=${configuration}, RuntimeFlavor=${runtimeFlavor}, ProductVersion=${productVersion}, ContinuousIntegrationBuild=${isContinuousIntegrationBuild}`);\n\nexport const banner = \"//! Licensed to the .NET Foundation under one or more agreements.\\n//! The .NET Foundation licenses this file to you under the MIT license.\\n//! This is generated file, see src/native/rollup.config.js\\n\\n\";\nexport const banner_dts = banner + \"//! This is not considered public API with backward compatibility guarantees. \\n\";","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/native/rollup.config.defines.js#L1-L27","documentation":"This rollup configuration module (executed at build time when bundling the dotnet wasm JS runtime) requires the ContinuousIntegrationBuild environment variable to be defined. It throws early because downstream code branches on whether the build is CI (isContinuousIntegrationBuild), and an undefined value would silently produce wrong output paths/diagnostics.","triggerScenarios":"Running the rollup build (e.g. `npm run build` invoking rollup.config.js which imports rollup.config.defines.js) without setting ContinuousIntegrationBuild in the environment. The check at rollup.config.defines.js:8-10 fails fast.","commonSituations":"Running the build locally for the first time without sourcing the project's build props. IDE/VS Code task that does not load env vars. A custom script invoking rollup directly instead of through the official build target that sets the vars.","solutions":["Drive the build through the repo's official target (e.g. `dotnet build`/`dotnet msbuild` of the native project) which sets ContinuousIntegrationBuild, Configuration, and ProductVersion for you.","If invoking rollup manually, set the env var: `ContinuousIntegrationBuild=false` (use 'true' for CI semantics).","Add the variable to your shell/CI environment so it is always defined for this repo."],"exampleFix":"# before\nrollup -c  # throws ContinuousIntegrationBuild not defined\n\n# after\nContinuousIntegrationBuild=false Configuration=Debug ProductVersion=8.0.0 rollup -c","handlingStrategy":"validation","validationCode":"// Validate required build env vars before invoking rollup.\nconst REQUIRED = ['ContinuousIntegrationBuild', 'Configuration', 'ProductVersion'] as const;\nconst missing = REQUIRED.filter(k => process.env[k] === undefined);\nif (missing.length) {\n  throw new Error(`Set env vars before building: ${missing.join(', ')}`);\n}","typeGuard":"function hasCiBuildEnv(env: NodeJS.ProcessEnv): boolean {\n  return env.ContinuousIntegrationBuild !== undefined;\n}","tryCatchPattern":null,"preventionTips":["Always build via the project's MSBuild target, which sets the env vars.","Document the required env vars in the native README.","Add a pre-build guard that lists missing vars with a helpful message."],"tags":["dotnet-wasm","build","rollup","environment-variables","config"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}