bun
bun copied to clipboard
Throwing missing package error when using ioredis
What version of Bun is running?
0.3.0
What platform is your computer?
Darwin 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:52 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8112 arm64 arm
What steps can reproduce the bug?
Run JS/TS code with an ioredis
import, then run the code with bun.
Example code:
import Redis from "ioredis";
export const client = new Redis("redis://redis:6379");
Run: bun src/index.ts
How often does it reproduce? Is there a required condition?
This error always occurs
What is the expected behavior?
The expected behavior is that bun should successfully run the code w/ the ioredis
module w/o throwing this error
What do you see instead?
The following error appears after running bun src/index.ts
:
error: Cannot find package "dns" from "/Users/elias/Development/e.bio/node_modules/ioredis/built/cluster/ClusterOptions.js"
Additional information
I then tried installing the dns
module through the bun package manager, but that led me to another error while executing src/index.ts
:
error: Cannot find package "dgram" from "bun:wrap"
This is because we have not implemented support for node:dns
and node:dgram
, but it's on the roadmap.
it seems there isn't an available Redis client in Bun.
Got an error in node-redis
Cannot find package "tls"
#781
Well, since dns
has been implemented in bun canary (and will be released soon in bun 0.4.1
) and this issue originally talked about dns
and not tls
+ it wasn't a bug, just something not being implemented back then, I'll close this issue, so there's one open ticket less (might not make a big difference, but also useless to keep it open forever 👀).