Skip to content

Import of treaty seems broken in docker compose with Sveltekit (bun adapter) #237

@Kinsteen

Description

@Kinsteen

What version of Elysia is running?

Elysia 1.4.19, Eden 1.4.6

What platform is your computer?

Linux 6.18.2-zen2-1-zen x86_64 unknown

What steps can reproduce the bug?

I have created a minimal reproducer here: https://github.com/Kinsteen/eden-svelte-docker-compose-reproducer

The gist of it is that:

  • I want a docker container running the Sveltekit frontend with bun (with svelte-adapter-bun)
  • I have a Dockerfile that builds the project, and serve it
  • If I have an import treaty on a page, and the container is running in docker compose, the app will return a 500 without much error, other than [500 GET /] undefined
  • If the exact same container is running with docker run, we have the correct behavior (treaty is imported, page is shown correctly)

The docker compose is very simple:

services:
  ct:
    build:
      dockerfile: Dockerfile
    ports:
      - 3000:3000

docker compose up --build doesn't work, while docker run --rm -p 3000:3000 eden-svelte-reproducer-ct works.

There is a workaround however: if we copy node_modules/@elysiajs into the runner image (see commented line in the reproducer Dockerfile), it works in docker compose as it should 🤔

What is the expected behavior?

Treaty can be imported while the app is running in docker compose, from a bun build

What do you see instead?

Internal server error, 500 HTTP code, undefined in the console (only when running the image in docker compose)

Additional information

No response

Have you try removing the node_modules and bun.lockb and try again yet?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions