sergiodxa / remix-hono

Hono middlewares for Remix
MIT License
425 stars 11 forks source link

Doesn't work on Scaleway serverless functions or AWS Lambda #212

Open g3r4n opened 4 months ago

g3r4n commented 4 months ago

If I import the build like :

import * as build from '@remix-run/dev/server-build'

it doesn't work with the following error:

handler could not be imported: Error: @remix-run/dev/server-build is not meant to be used directly from node_modules. It exists to provide type definitions for a virtual module provided by the Remix compiler at build time.

So I change the import to the build output from vite:

import * as build from "../build/server/remix";

I've got a new error:

handler could not be imported: Error: Dynamic require of "http" is not supported

From what I see my issue comes from the entry.server.tsx file which use createReadableStreamFromReadable which requires native node module "http" that is not available. I think I've to recreate this file to work with Hono. any idea how can I do it ? Do you have an exemple I can used? Am I doing something wrong ? I'm building the function that I deploy using esbuild that's how I managed to track what was requiring the http module.