{"record":{"id":"cc5f1ba9aefaa8b5","repo":"sveltejs/kit","slug":"directory-pathname-is-a-reserved-query-par","errorCode":null,"errorMessage":"${directory}: `__pathname` is a reserved query parameter for `isr.allowQuery`","messagePattern":"(.+?): `__pathname` is a reserved query parameter for `isr\\.allowQuery`","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-vercel/index.js","lineNumber":123,"sourceCode":"\t\t\t\t\tthrow new Error('The `edge` runtime is no longer supported');\n\t\t\t\t}\n\n\t\t\t\tconst runtime = resolve_runtime(defaults.runtime, route.config.runtime);\n\n\t\t\t\tconst config = { ...defaults, ...route.config, runtime };\n\n\t\t\t\tif (is_prerendered(route)) {\n\t\t\t\t\tif (config.isr) {\n\t\t\t\t\t\tignored_isr.add(route.id);\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (config.isr) {\n\t\t\t\t\tconst directory = path.relative('.', builder.config.files.routes + route.id);\n\n\t\t\t\t\tif (config.isr.allowQuery?.includes('__pathname')) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`${directory}: \\`__pathname\\` is a reserved query parameter for \\`isr.allowQuery\\``\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tisr_config.set(route, {\n\t\t\t\t\t\texpiration: config.isr.expiration,\n\t\t\t\t\t\tbypassToken: config.isr.bypassToken,\n\t\t\t\t\t\tallowQuery: ['__pathname', ...(config.isr.allowQuery ?? [])],\n\t\t\t\t\t\tgroup: isr_config.size + 1,\n\t\t\t\t\t\tpassQuery: true\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst hash = hash_config(config);\n\n\t\t\t\t// first, check there are no routes with incompatible configs that will be merged\n\t\t\t\tconst pattern = route.pattern.toString();\n\t\t\t\tconst existing = conflicts.get(pattern);","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-vercel/index.js#L105-L141","documentation":"For ISR routes, adapter-vercel uses the synthetic `__pathname` query parameter internally to map a request URL to its prerendered variant. Users may not reserve it in `isr.allowQuery`, since allowing it would corrupt the cache-key mapping, so the adapter throws during adapt().","triggerScenarios":"A route's config sets `isr: { allowQuery: ['__pathname', ...] }` (or includes '__pathname' anywhere in the allowQuery array).","commonSituations":"Developer lists every query param the route can receive, inadvertently including __pathname after seeing it in generated Vercel config or URLs; cargo-culting from another project's ISR config.","solutions":["Remove '__pathname' from the route's isr.allowQuery array","List only real user-facing query parameters in allowQuery","Rebuild after the config change"],"exampleFix":"// before\nexport const config = { isr: { expiration: 60, allowQuery: ['__pathname', 'lang'] } };\n// after\nexport const config = { isr: { expiration: 60, allowQuery: ['lang'] } };","handlingStrategy":"validation","validationCode":"const allowQuery = config?.isr?.allowQuery ?? [];\nif (allowQuery.includes('__pathname')) {\n  throw new Error('isr.allowQuery must not include the reserved \"__pathname\" param');\n}","typeGuard":"const reservesPathname = (config) =>\n  Array.isArray(config?.isr?.allowQuery) && config.isr.allowQuery.includes('__pathname');","tryCatchPattern":"try {\n  await build();\n} catch (err) {\n  if (err.message.includes('__pathname')) {\n    console.error('Remove __pathname from isr.allowQuery in the named route config.');\n  }\n  throw err;\n}","preventionTips":["Treat names starting with __ as framework-reserved","Only list user-facing params in allowQuery","Add a code-review checklist item for ISR configs","Document reserved query params for the team"],"tags":["config","vercel","isr","reserved-keyword"],"backgroundTag":"reserved-parameter-conflict","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}