dotnet/runtime · error · Error
ContinuousIntegrationBuild environment variable is not defin
Error message
ContinuousIntegrationBuild environment variable is not defined
What it means
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.
Source
Thrown at src/native/rollup.config.defines.js:9
//! Licensed to the .NET Foundation under one or more agreements.
//! The .NET Foundation licenses this file to you under the MIT license.
/* eslint-disable no-console */
import gitCommitInfo from "git-commit-info";
if (process.env.ContinuousIntegrationBuild === undefined) {
throw new Error("ContinuousIntegrationBuild environment variable is not defined");
}
if (process.env.Configuration === undefined) {
throw new Error("Configuration environment variable is not defined");
}
if (process.env.ProductVersion === undefined) {
throw new Error("ProductVersion environment variable is not defined");
}
export const configuration = process.env.Configuration !== "Release" && process.env.Configuration !== "RELEASE" ? "Debug" : "Release";
export const runtimeFlavor = process.env.RuntimeFlavor || "CoreCLR";
export const productVersion = process.env.ProductVersion;
export const isContinuousIntegrationBuild = process.env.ContinuousIntegrationBuild === "true" ? true : false;
export const staticLibDestination = process.env.StaticLibDestination || `../../artifacts/obj/native/net${productVersion}-browser-${configuration}-wasm/lib`;
console.log(`Rollup configuration: Configuration=${configuration}, RuntimeFlavor=${runtimeFlavor}, ProductVersion=${productVersion}, ContinuousIntegrationBuild=${isContinuousIntegrationBuild}`);
export 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";
export const banner_dts = banner + "//! This is not considered public API with backward compatibility guarantees. \n";View on GitHub (pinned to 60108ba66e)
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.
Example fix
# before rollup -c # throws ContinuousIntegrationBuild not defined # after ContinuousIntegrationBuild=false Configuration=Debug ProductVersion=8.0.0 rollup -c
Defensive patterns
Strategy: validation
Validate before calling
// Validate required build env vars before invoking rollup.
const REQUIRED = ['ContinuousIntegrationBuild', 'Configuration', 'ProductVersion'] as const;
const missing = REQUIRED.filter(k => process.env[k] === undefined);
if (missing.length) {
throw new Error(`Set env vars before building: ${missing.join(', ')}`);
} Type guard
function hasCiBuildEnv(env: NodeJS.ProcessEnv): boolean {
return env.ContinuousIntegrationBuild !== undefined;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Configuration environment variable is not defined
- ProductVersion environment variable is not defined
- Expected environment variable '${k}' to be a string but it w
- Unexpected behavior ${asset.behavior} of asset ${asset.name}
- __stack_pointer was not preserved by the linker or optimizer
AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10).
Data as JSON: /api/errors/736da8b40f710071.
Report an issue: GitHub.