diff --git a/templates/cloudflare/functions/[[path]].ts b/templates/cloudflare/functions/[[path]].ts index 26a7de6b0e7..9b1e73ac26f 100644 --- a/templates/cloudflare/functions/[[path]].ts +++ b/templates/cloudflare/functions/[[path]].ts @@ -1,8 +1,13 @@ +import type { ServerBuild } from "@remix-run/cloudflare"; import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - the server build file is generated by `remix vite:build` // eslint-disable-next-line import/no-unresolved -import * as build from "../build/server"; +import * as rawBuild from "../build/server"; + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore - the server build is a js file and as such it doesn't include all the appropriate types +const build = rawBuild as ServerBuild; export const onRequest = createPagesFunctionHandler({ build });