{"record":{"id":"8e462384582ccf6d","repo":"sveltejs/kit","slug":"env-dynamic-private-is-deprecated-use-app-en","errorCode":null,"errorMessage":"`$env/dynamic/private` is deprecated, use `$app/env/private` instead","messagePattern":"`\\$env/dynamic/private` is deprecated, use `\\$app/env/private` instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/kit/src/runtime/env/dynamic/private.js","lineNumber":6,"sourceCode":"import { DEV } from 'esm-env';\nimport * as env from '../../app/env/private/index.js';\nexport { env };\n\nif (DEV) {\n\tconsole.warn('`$env/dynamic/private` is deprecated, use `$app/env/private` instead');\n}\n","sourceCodeStart":1,"sourceCodeEnd":8,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/env/dynamic/private.js#L1-L8","documentation":"The `$env/dynamic/private` module is deprecated; it re-exports the environment from the new `$app/env/private` location and emits this DEV warning at import time. Dynamic private environment variables are still available, but you should import from the new module. Existing behavior is unchanged aside from the warning.","triggerScenarios":"Importing `import { env } from '$env/dynamic/private'` (or importing the module at all) in server-only code during development.","commonSituations":"Server code (hooks, +server.ts, endpoints) written against the older env module path; upgrades to the SvelteKit version that introduced `$app/env` modules.","solutions":["Change imports to `import { env } from '$app/env/private'`","Keep usage of `env.VAR_NAME` identical — only the module specifier changes","Update shared server utilities that re-export from `$env/dynamic/private`"],"exampleFix":"// before\nimport { env } from '$env/dynamic/private';\n// after\nimport { env } from '$app/env/private';","handlingStrategy":"validation","validationCode":"import { env } from '$app/env/private'; // only ever import env from $app/env/*\nif (DEV && process.env.SVELTEKIT_ENV_CHECK) console.assert(!envModulesUseLegacy, 'legacy $env/dynamic/private import');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Import env exclusively from $app/env/private in server-only modules","Add import lint rules restricting $env/* specifiers","Grep for `$env/dynamic/private` during dependency upgrades"],"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"}