fix: add error-handler type to manifest (#1933)

This commit is contained in:
Christian Svensson
2023-10-16 07:45:34 +02:00
committed by GitHub
parent 86a96eeee4
commit 206d5002d6
4 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ export async function getServerContext(opts: InternalFreshConfig) {
if (!url.startsWith(baseUrl + "routes")) {
throw new TypeError("Page is not a child of the basepath.");
}
const path = url.substring(baseUrl.length).substring("routes".length);
const path = url.substring(baseUrl.length + "routes".length);
const baseRoute = path.substring(1, path.length - extname(path).length);
const name = baseRoute.replace("/", "-");
const isLayout = path.endsWith("/_layout.tsx") ||
+8 -3
View File
@@ -74,9 +74,14 @@ export interface Manifest {
ctx: any,
// deno-lint-ignore no-explicit-any
) => Promise<any | Response> | any;
// deno-lint-ignore no-explicit-any
handler?: Handler<any, any> | Handlers<any, any> | UnknownHandler;
config?: RouteConfig | LayoutConfig | ErrorHandler;
handler?:
// deno-lint-ignore no-explicit-any
| Handler<any, any>
// deno-lint-ignore no-explicit-any
| Handlers<any, any>
| UnknownHandler
| ErrorHandler;
config?: RouteConfig | LayoutConfig;
} | MiddlewareModule
>;
islands: Record<string, IslandModule>;