{"record":{"id":"e61f0a1e1191eefb","repo":"sveltejs/kit","slug":"cannot-use-read-from-app-server-in-route-id","errorCode":null,"errorMessage":"Cannot use `read` from `$app/server` in ${route_id} when using ${adapter.name}. Please ensure that your adapter is up to date and supports this feature.","messagePattern":"Cannot use `read` from `\\$app/server` in (.+?) when using (.+?)\\. Please ensure that your adapter is up to date and supports this feature\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/kit/src/utils/features.js","lineNumber":18,"sourceCode":"/**\n * @param {string} route_id\n * @param {Record<string, any>} config\n * @param {string} feature\n * @param {import('@sveltejs/kit').Adapter | undefined} adapter\n */\nexport function check_feature(route_id, config, feature, adapter) {\n\tif (!adapter) return;\n\n\tswitch (feature) {\n\t\tcase '$app/server:read': {\n\t\t\tconst supported = adapter.supports?.read?.({\n\t\t\t\troute: { id: route_id },\n\t\t\t\tconfig\n\t\t\t});\n\n\t\t\tif (!supported) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Cannot use \\`read\\` from \\`$app/server\\` in ${route_id} when using ${adapter.name}. Please ensure that your adapter is up to date and supports this feature.`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/utils/features.js#L1-L25","documentation":"`read` from `$app/server` lets load functions and endpoints read assets (e.g. import.json files or content collections) from the deployment. Because reading files is platform-specific, each adapter must declare `supports.read`. If the configured adapter doesn't claim support for the route, Kit throws this error at build/dev analysis time.","triggerScenarios":"Using `read` in a +page.server.js/+layout.server.js/+server.js while the project's adapter either predates `supports.read` or explicitly returns false for the route (e.g. a static adapter or an outdated adapter version).","commonSituations":"Projects using adapter-static where `read` can't work; adapters not yet updated for the `read` feature; pnpm/monorepo setups resolving an old adapter copy; new Kit feature used with a pinned old adapter.","solutions":["Upgrade the adapter to the latest version that supports `read` (pnpm update @sveltejs/adapter-*)","If on adapter-static, remove `read` usage or switch to an adapter that supports it (e.g. adapter-node)","Ensure only one adapter version is installed (check pnpm why / lockfile for duplicates)","If the adapter genuinely supports it but still fails, file an issue with adapter version and route id"],"exampleFix":"// before\n\"devDependencies\": { \"@sveltejs/adapter-node\": \"2.0.0\" }\n// after\n\"devDependencies\": { \"@sveltejs/adapter-node\": \"^5.2.0\" }","handlingStrategy":"validation","validationCode":"// before using read, verify adapter support\nimport { read } from '$app/server';\n// check svelte.config.js: the chosen adapter must declare supports.read","typeGuard":"const adapterSupportsRead = (adapter) => typeof adapter?.supports?.read === 'function' || adapter?.supports?.read === true;","tryCatchPattern":"// Thrown at build/analysis time; guard at config level instead.\n// In CI:\nconst config = require('./svelte.config.js');\nif (usesRead && !adapterSupportsRead(config.kit.adapter)) {\n  throw new Error('Adapter does not support read — upgrade or switch adapters');\n}","preventionTips":["Pin and regularly update your adapter (@sveltejs/adapter-*)","Don't use `read` with adapter-static; use a supporting adapter instead","Check adapter changelogs before adopting newer Kit features","In monorepos, verify the adapter version actually resolved (pnpm why)"],"tags":["adapter","read","build","compatibility"],"backgroundTag":"adapter-feature-unsupported","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}