{"record":{"id":"3609a6b766c4590c","repo":"sveltejs/kit","slug":"app-environment-is-deprecated-use-app-env-i","errorCode":null,"errorMessage":"`$app/environment` is deprecated, use `$app/env` instead","messagePattern":"`\\$app/environment` is deprecated, use `\\$app/env` instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/kit/src/runtime/app/environment/index.js","lineNumber":5,"sourceCode":"import { DEV } from 'esm-env';\nexport * from '../env/index.js';\n\nif (DEV) {\n\tconsole.warn('`$app/environment` is deprecated, use `$app/env` instead');\n}\n","sourceCodeStart":1,"sourceCodeEnd":7,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/app/environment/index.js#L1-L7","documentation":"Importing the module `$app/environment` (packages/kit/src/runtime/app/environment/index.js) re-exports `$app/env` for backwards compatibility and warns once in dev that the old path is deprecated. All exports are identical; only the import path changed.","triggerScenarios":"Any `import { browser, dev, prerendering, building, version } from '$app/environment'` in app code during dev.","commonSituations":"Older SvelteKit projects or AI/tutorial snippets predating the `$app/env` rename; dependencies importing the old path.","solutions":["Change the import specifier to `$app/env`: `import { browser, dev } from '$app/env'`","Run a codemod/search-replace of `'$app/environment'` → `'$app/env'` across src","Update any local typings/aliases that still reference `$app/environment`"],"exampleFix":"// before\nimport { browser } from '$app/environment';\n// after\nimport { browser } from '$app/env';","handlingStrategy":"validation","validationCode":"// fail CI if deprecated import path is used\n// grep -rn \"\\$app/environment\" src && exit 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Import from `$app/env` in all new code","Add a lint/no-restricted-imports rule for '$app/environment'","Update internal shared packages that re-export from the old path"],"tags":["deprecation","imports","sveltekit"],"backgroundTag":"deprecated-module-path","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}