elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
10.12k stars 215 forks source link

Bundling typebox? #317

Closed JakeHedman closed 1 month ago

JakeHedman commented 10 months ago

dist/bun/index.js seems to include a full copy of @sinclair/typebox. It breaks TypeSystem.Type, TypeSystem.Format etc since elysia uses an internal typebox instance. elysia/type-system exports the global typebox instance so there is no way to access the elysia typebox.

Micnubinub commented 10 months ago

For me its breaking my builds, I'm getting a lot of TypeBoxError: Duplicate type kind 'Files' detected. I don't know if this was the best idea

SaltyAom commented 9 months ago

Elysia now excludes TypeBox from bundling in 0.8.7.

Feels free to reopen the discussion if need.

SaltyAom commented 9 months ago

Reopen because when TypeBox is excluded from Bun bundle causing an error (see 0.8.7) If added back (only change in 0.8.8), it seems to be working again.

Not sure why this happen but seems like we can't find a way to do that just yet.

JakeHedman commented 9 months ago

Both 0.8.7 and 0.8.8 work fine on my machine. How can I reproduce that error to troubleshoot it?