{"record":{"id":"45d9e848fa3fd7fe","repo":"withastro/astro","slug":"the-injected-route-injectroute-pattern-by-i","errorCode":null,"errorMessage":"The injected route \"${injectRoute.pattern}\" by ${integration.name} specifies the entry point with the \"entryPoint\" property. This property is deprecated, please use \"entrypoint\" instead.","messagePattern":"The injected route \"(.+?)\" by (.+?) specifies the entry point with the \"entryPoint\" property\\. This property is deprecated, please use \"entrypoint\" instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro/src/integrations/hooks.ts","lineNumber":259,"sourceCode":"\t\t\t\t\t\t\tastroJSXRenderer = renderer;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tupdatedSettings.renderers.push(renderer);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tinjectScript: (stage, content) => {\n\t\t\t\t\t\tupdatedSettings.scripts.push({ stage, content });\n\t\t\t\t\t},\n\t\t\t\t\tupdateConfig: (newConfig) => {\n\t\t\t\t\t\t// Logger destination is updated later because it's async\n\t\t\t\t\t\tif (newConfig.logger?.entrypoint) {\n\t\t\t\t\t\t\tisLoggerUpdated = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdatedConfig = mergeConfig(updatedConfig, newConfig);\n\t\t\t\t\t\treturn { ...updatedConfig };\n\t\t\t\t\t},\n\t\t\t\t\tinjectRoute: (injectRoute) => {\n\t\t\t\t\t\tif (injectRoute.entrypoint == null && 'entryPoint' in injectRoute) {\n\t\t\t\t\t\t\tlogger.warn(\n\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t`The injected route \"${injectRoute.pattern}\" by ${integration.name} specifies the entry point with the \"entryPoint\" property. This property is deprecated, please use \"entrypoint\" instead.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tinjectRoute.entrypoint = injectRoute.entryPoint as string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdatedSettings.injectedRoutes.push({ ...injectRoute, origin: 'external' });\n\t\t\t\t\t},\n\t\t\t\t\taddWatchFile: (path) => {\n\t\t\t\t\t\tupdatedSettings.watchFiles.push(path instanceof URL ? fileURLToPath(path) : path);\n\t\t\t\t\t},\n\t\t\t\t\taddDevToolbarApp: (entrypoint) => {\n\t\t\t\t\t\tupdatedSettings.devToolbarApps.push(entrypoint);\n\t\t\t\t\t},\n\t\t\t\t\taddClientDirective: ({ name, entrypoint }) => {\n\t\t\t\t\t\tif (updatedSettings.clientDirectives.has(name) || addedClientDirectives.has(name)) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`The \"${integration.name}\" integration is trying to add the \"${name}\" client directive, but it already exists.`,\n\t\t\t\t\t\t\t);","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro/src/integrations/hooks.ts#L241-L277","documentation":"In the astro:config:setup hook, integrations register server routes via injectRoute({ pattern, entrypoint }). The object still tolerates the legacy entryPoint (capital P) key: when entrypoint is absent but entryPoint is present, Astro warns (aimed at the integration author), copies the value into entrypoint, and registers the route anyway.","triggerScenarios":"An integration (dependency or in-repo plugin) calls injectRoute({ pattern: '/x', entryPoint: 'src/x.ts' }) — entrypoint is null/undefined and 'entryPoint' is present in the object.","commonSituations":"Older community integrations not yet migrated to the lowercase key; in-house integrations written before the rename; warnings appearing in user logs even though the injected route keeps working.","solutions":["If it is your integration, rename the key: injectRoute({ pattern, entrypoint: '...' })","If third-party, upgrade to a release using entrypoint, or open an issue/PR upstream","No functional action required — the route still registers; the fix is purely to silence the deprecation"],"exampleFix":"// integration — before\ninjectRoute({ pattern: '/admin', entryPoint: 'src/routes/admin.ts' });\n\n// after\ninjectRoute({ pattern: '/admin', entrypoint: 'src/routes/admin.ts' });","handlingStrategy":"type-guard","validationCode":"function usesLegacyKey(r: { entrypoint?: unknown } & Record<string, unknown>): boolean {\n  return r.entrypoint == null && 'entryPoint' in r;\n}\n// in your integration's setup hook, assert !usesLegacyKey(route) before injectRoute","typeGuard":"type LegacyInjectRoute = { pattern: string; entryPoint: string };\nfunction isLegacyInjectRoute(\n  r: { entrypoint?: unknown } & Record<string, unknown>\n): r is LegacyInjectRoute {\n  return r.entrypoint == null && 'entryPoint' in r;\n}","tryCatchPattern":null,"preventionTips":["Use the lowercase entrypoint key in all injectRoute calls","Type injectRoute arguments against Astro's integration types so legacy keys fail typecheck","Upgrade community integrations that still log this warning, or patch them upstream"],"tags":["integrations","injectroute","deprecation","api-rename"],"backgroundTag":"deprecated-api-option","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}