Skip to content

Commit

Permalink
fix: add type casting for fixing the incompatible raw server build in…
Browse files Browse the repository at this point in the history
… the Cloudflare template
  • Loading branch information
dario-piotrowicz committed Oct 6, 2024
1 parent 5954ad1 commit e583a65
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion templates/cloudflare/functions/[[path]].ts
Original file line number Diff line number Diff line change
@@ -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 });

0 comments on commit e583a65

Please sign in to comment.