{"record":{"id":"9d98193682d3c9e3","repo":"sveltejs/kit","slug":"env-dynamic-public-is-deprecated-use-app-env","errorCode":null,"errorMessage":"`$env/dynamic/public` is deprecated, use `$app/env/public` instead","messagePattern":"`\\$env/dynamic/public` is deprecated, use `\\$app/env/public` instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/kit/src/runtime/env/dynamic/public.js","lineNumber":6,"sourceCode":"import { DEV } from 'esm-env';\nimport * as env from '../../app/env/public/index.js';\nexport { env };\n\nif (DEV) {\n\tconsole.warn('`$env/dynamic/public` is deprecated, use `$app/env/public` instead');\n}\n","sourceCodeStart":1,"sourceCodeEnd":8,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/env/dynamic/public.js#L1-L8","documentation":"The `$env/dynamic/public` module is deprecated in favor of `$app/env/public`. The module re-exports the same public dynamic environment object and prints this DEV warning when imported. Functionality is otherwise unchanged; only the import path should move.","triggerScenarios":"Importing `import { env } from '$env/dynamic/public'` anywhere in client or shared code during development.","commonSituations":"Client components reading public env (e.g. API keys, feature flags) via the old specifier; codebases updated to a SvelteKit version that renamed env modules under `$app/env`.","solutions":["Change imports to `import { env } from '$app/env/public'`","Leave `env.VAR_NAME` accesses as-is","Update re-export barrels or shared config modules referencing the old path"],"exampleFix":"// before\nimport { env } from '$env/dynamic/public';\n// after\nimport { env } from '$app/env/public';","handlingStrategy":"validation","validationCode":"import { env } from '$app/env/public'; // correct specifier\n// CI grep: ! grep -r \"\\$env/dynamic/public\" src/","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use $app/env/public for public env access","Restrict legacy $env/* imports via lint rules","Search codebase for old specifier when upgrading SvelteKit"],"tags":["deprecation","environment","env-variables","imports","sveltekit"],"backgroundTag":"deprecated-env-module","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}