vercel/turborepo · warning

finished with warnings

Error message

finished with warnings

What it means

Printed by the task visitor after a run finishes, when tasks recorded warnings during execution. In this codebase the collected warnings are missing platform env vars: with EnvMode::Strict, tasks that declare env/globalEnv/passThroughEnv variables which are unset at runtime are collected, and after 'finished with warnings' turbo prints each missing variable together with its task id. The run still completes; this is a summary of per-task strict-env findings.

Solutions

  1. Set the missing variables listed after the header (e.g. export them in CI before turbo runs)
  2. Fix typos in the env/globalEnv/passThroughEnv declarations in turbo.json or package.json
  3. If the variable is genuinely optional, run with `--env-mode=loose`
  4. Re-run and confirm the warning block no longer appears

Example fix

# before: turbo.json
"tasks": { "build": { "env": ["TURBO_TOKE"] } }

# after: turbo.json
"tasks": { "build": { "env": ["TURBO_TOKEN"] } }
Defensive patterns

Strategy: validation

Validate before calling

# CI preflight: fail fast when strict-mode env vars are missing
# (mirror the turbo.json env declarations)
for v in TURBO_TOKEN ANOTHER_VAR; do
  if [ -z "${!v}" ]; then echo "missing env: $v"; exit 1; fi
done
turbo run build --env-mode=strict

Prevention

When it happens

Trigger: Running `turbo run <task> --env-mode=strict` (or with strict env mode enabled) where a task's turbo.json `env`/`globalEnv`/`passThroughEnv` lists variables absent from the environment; each such task pushes a warning (exposing missing_platform_env and task_id) that this header introduces.

Common situations: CI jobs that forgot to export a token referenced in turbo.json; typos in variable names inside env declarations; strict env mode newly enabled in a repo where some variables are only set on developer machines.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17). Data as JSON: /api/errors/898c7a76c5780381. Report an issue: GitHub.

Appendix: source

Thrown at crates/turborepo-lib/src/task_graph/visitor/mod.rs:1078

        incremental_cache: Option<turborepo_run_summary::IncrementalCacheSummary>,
    ) -> Result<(), Error> {
        let Self {
            package_graph,
            color_config: ui,
            run_opts,
            repo_root,
            global_env_mode,
            task_hasher,
            is_watch,
            ..
        } = self;

        let global_hash_summary = GlobalHashSummary::try_from(global_hash_inputs)?;

        // output any warnings that we collected while running tasks
        if let Ok(warnings) = self.warnings.lock() {
            if !warnings.is_empty() {
                turborepo_log::warn(
                    turborepo_log::Source::turbo(turborepo_log::Subsystem::Run),
                    "finished with warnings",
                )
                .emit();

                PlatformEnv::output_header(global_env_mode == EnvMode::Strict, self.color_config);

                for warning in warnings.iter() {
                    PlatformEnv::output_for_task(
                        warning.missing_platform_env().to_owned(),
                        warning.task_id(),
                        self.color_config,
                    )
                }
            }
        }

        Ok(self

View on GitHub (pinned to f9245100cf)