{"record":{"id":"898c7a76c5780381","repo":"vercel/turborepo","slug":"finished-with-warnings","errorCode":null,"errorMessage":"finished with warnings","messagePattern":"finished with warnings","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/turborepo-lib/src/task_graph/visitor/mod.rs","lineNumber":1078,"sourceCode":"        incremental_cache: Option<turborepo_run_summary::IncrementalCacheSummary>,\n    ) -> Result<(), Error> {\n        let Self {\n            package_graph,\n            color_config: ui,\n            run_opts,\n            repo_root,\n            global_env_mode,\n            task_hasher,\n            is_watch,\n            ..\n        } = self;\n\n        let global_hash_summary = GlobalHashSummary::try_from(global_hash_inputs)?;\n\n        // output any warnings that we collected while running tasks\n        if let Ok(warnings) = self.warnings.lock() {\n            if !warnings.is_empty() {\n                turborepo_log::warn(\n                    turborepo_log::Source::turbo(turborepo_log::Subsystem::Run),\n                    \"finished with warnings\",\n                )\n                .emit();\n\n                PlatformEnv::output_header(global_env_mode == EnvMode::Strict, self.color_config);\n\n                for warning in warnings.iter() {\n                    PlatformEnv::output_for_task(\n                        warning.missing_platform_env().to_owned(),\n                        warning.task_id(),\n                        self.color_config,\n                    )\n                }\n            }\n        }\n\n        Ok(self","sourceCodeStart":1060,"sourceCodeEnd":1096,"githubUrl":"https://github.com/vercel/turborepo/blob/f9245100cf0d31d96628804ead485f6bf226e55a/crates/turborepo-lib/src/task_graph/visitor/mod.rs#L1060-L1096","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set the missing variables listed after the header (e.g. export them in CI before turbo runs)","Fix typos in the env/globalEnv/passThroughEnv declarations in turbo.json or package.json","If the variable is genuinely optional, run with `--env-mode=loose`","Re-run and confirm the warning block no longer appears"],"exampleFix":"# before: turbo.json\n\"tasks\": { \"build\": { \"env\": [\"TURBO_TOKE\"] } }\n\n# after: turbo.json\n\"tasks\": { \"build\": { \"env\": [\"TURBO_TOKEN\"] } }","handlingStrategy":"validation","validationCode":"# CI preflight: fail fast when strict-mode env vars are missing\n# (mirror the turbo.json env declarations)\nfor v in TURBO_TOKEN ANOTHER_VAR; do\n  if [ -z \"${!v}\" ]; then echo \"missing env: $v\"; exit 1; fi\ndone\nturbo run build --env-mode=strict","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare every env var a task needs in turbo.json (env / passThroughEnv / globalEnv) so strict mode can verify them","Add a CI step that diffs the required env vars against exported secrets before turbo runs","Use --env-mode=loose for local development where optional variables are common","Read the 'finished with warnings' block carefully — each line names the variable and the task id to fix"],"tags":["env-vars","strict-mode","task-run","turborepo"],"backgroundTag":"missing-env-var","analyzedSha":"f9245100cf0d31d96628804ead485f6bf226e55a","analyzedAt":"2026-08-17T10:46:15.696Z","schemaVersion":2},"datasetVersion":"2026-08-21T08:17:14.275Z"}