Skip to content

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

@g3r4n

Description

@g3r4n

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions