A while ago, I started using Bun instead of Node.js, because of a lot of DX improvements. Not having to worry about TypeScript files or ESM support is really good. Unfortunately, bun has a lot of edge cases with no solutions, that make using it a nightmare. I intend to collect these things in this article over time.
Since I have already committed to using Bun in production, I can’t simply switch back to Node.js now. But it is important to keep these things in mind, when making your decision. At the time of writing this article, Deno 2.0 looks much more promising than Bun. And while Node.js has a lot of annoying quirks, it is certainly much more stable than Bun.
- Bun does not support Alpine Linux (Docker)
- oven-sh/setup-bun has been broken for a long time
- Workaround: always download either latest or a specific version
- The new AWS SDK seems to be incompatible with Bun (random segfaults all the time)
- Workaround: old SDK works fine
- bun build is super broken, especially minifying
- Workaround: stick to esbuild
- bun build –compile doesn’t work with wasm dependencies (e.g. when using ink for CLIs)
- haven’t found a workaround yet
- bun test is just as broken, especially mocking
- Workaround: stick to vitest
- Installing the current project as a local global dependency does not work in bun
- haven’t found a workaround yet