Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elysia suffers from dual package hazard #1143

Open
matthewlilley opened this issue Mar 27, 2025 · 0 comments
Open

Elysia suffers from dual package hazard #1143

matthewlilley opened this issue Mar 27, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@matthewlilley
Copy link

What version of Elysia is running?

latest

What platform is your computer?

Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Create an Elysia project with "type": "module" in the package.json

Elysia modules are imported as CJS, so then when you use a package like TypeBox which doesn't suffer from the dual package hazard, it will import the ESM versions of the code which are incompatible with Elysia exported TypeBox modules.

The workaround for now is to patch TypeBox so that it only exports CJS which isn't preferable, but has to be done to use TypeBox alongside Elysia in an ESM based project.

What is the expected behavior?

If the project using Elysia has a "type": "module" specified, it should use ESM code from Elysia, which would mean that TypeBox can be used as expected.

What do you see instead?

No response

Additional information

No response

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

No response

@matthewlilley matthewlilley added the bug Something isn't working label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant