#Use Bun even when compatibility is a problem

1 messages · Page 1 of 1 (latest)

bright hound
#

please provide more info, such as the exact error/issue you face when trying to use jimp on bun

#

the answer to your question is it vastly depends on a case-by-case basis depending on what the actual cause of the problem

pure jacinth
#

i tried using bun build --target=bun on jimp but it didnt seem to work

#

thats your best bet since bun build does the cjs+esm interop stuff different than the runtime

#

its also quite anoying to have an extra build step but if it works you're stuck with that for now.

pure jacinth
#

the way that bun handles commonjs + es modules
in this case it mistakingly thinks one of jimps' es modules is a commonjs module (since it extends the event emitter class). thats a bug in bun

bun build is a javascript bundler that will bundle a file and all of its dependencies into one file

#

you can use it like bun build --target=bun index.ts --outfile=bundle.js where that imports jimp and your other app code

then you can run bun bundle.js to run it

pure jacinth
#

yeah