diff --git a/src/rollup/plugins/handlers.ts b/src/rollup/plugins/handlers.ts index 149a801f25..f59ac41e4f 100644 --- a/src/rollup/plugins/handlers.ts +++ b/src/rollup/plugins/handlers.ts @@ -77,7 +77,7 @@ ${handlers h.handler, h.lazy )}, lazy: ${!!h.lazy}, middleware: ${!!h.middleware}, method: ${JSON.stringify( - h.method + h.method?.toLowerCase() )} }` ) .join(",\n")} @@ -98,7 +98,7 @@ export const handlersMeta = [ .map( (h) => /* js */ `{ route: ${JSON.stringify(h.route)}, method: ${JSON.stringify( - h.method + h.method?.toLowerCase() )}, meta: ${getImportId(h.handler)}Meta }` ) .join(",\n")} diff --git a/test/fixture/nitro.config.ts b/test/fixture/nitro.config.ts index e759e91a9d..a5c387b4c1 100644 --- a/test/fixture/nitro.config.ts +++ b/test/fixture/nitro.config.ts @@ -16,6 +16,8 @@ export default defineNitroConfig({ { route: "/api/test/*/foo", handler: "~/api/hello.ts", + // @ts-expect-error #2382 + method: "GET", }, ], devProxy: {