Chainlit / literalai-typescript

https://docs.literalai.com
Apache License 2.0
5 stars 0 forks source link

fix(deps): restore compatibility with Next.js build #31

Closed Dam-Buty closed 4 months ago

Dam-Buty commented 4 months ago

The Next.js build system was too aggressive in its tree shaking and removed mime-types from the bundle (required by form-data which is required by @literalai/client).

It was the dumbest thing as mime-types was declared as a dep despite not being imported anywhere in the code, while form-data was imported in the code but not declared as a dep. This didn't trigger any compile error as it is mainlined in Node (and presumed to exist by tsc/swc) but the build process messed the whole dependency graph and the error appeared at runtime.