Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when using with bun #13

Open
vitch opened this issue Dec 17, 2024 · 4 comments
Open

Issue when using with bun #13

vitch opened this issue Dec 17, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@vitch
Copy link

vitch commented Dec 17, 2024

I've just discovered this package and am trying to use it in my bun app.

Unfortunately there is this error on boot:

error: Cannot find module '../build/Debug/zstd.node' from '/node_modules/@mongodb-js/zstd/lib/index.js'

Bun version 1.1.33

It looks like it's getting the expected version of @mongodb-js/zstd:

"@mongodb-js/zstd@^2.0.0": 
  version "2.0.0"
  resolved "https://registry.npmjs.org/@mongodb-js/zstd/-/zstd-2.0.0.tgz"
  integrity sha512-Tcx42XboNLDW9IBxyBxd+m1Wwk1Bdm33oLD5s1phQcmkg1eN0gDx7Z8uJUJjwz35kF2UNd/EsXXT0C7Ckm0Y6g==
  dependencies: 
    node-addon-api "^4.3.0"
    prebuild-install "^7.1.2"

Any ideas?

@vuolter vuolter self-assigned this Dec 18, 2024
@vuolter vuolter added the bug Something isn't working label Dec 18, 2024
@vuolter
Copy link
Owner

vuolter commented Dec 18, 2024

Hi @vitch, thx for reporting this!

Meanwhile I release a fix, you can install the previous version of hono-compress (that should not be affected) with the cmd:

bun add hono-compress@0.6.0

Let me know if works fine 🙂

@vitch
Copy link
Author

vitch commented Dec 18, 2024

Thanks for the quick reply!

I can confirm that locking to hono-compress@0.6.0 works great... Thanks!

@mustafachyi
Copy link

when i tried to install it via bun i also had an issue with @mongodb-js/zstd it was saying something about it not being trusted

C:\Users\Administrator\Desktop\Bun-Backend>bun pm untrusted
bun pm untrusted v1.1.42 (50eec002)

.\node_modules\@mongodb-js\zstd @2.0.0
 » [install]: prebuild-install --runtime napi || npm run clean-install

These dependencies had their lifecycle scripts blocked during install.

If you trust them and wish to run their scripts, use `bun pm trust`.

for now i was able to fix it by using bun pm trust @mongodb-js/zstd after that it worked just fine. would be nice to have a better solution. still results were very good i don't mind using it even if it stayed this way

@phamquyhai
Copy link

phamquyhai commented Jan 4, 2025

Quick Fixed
Force @mongodb-js/zstd to use old version and keep hono-compress new version.

Update package.json

  "resolutions": {
    "@mongodb-js/zstd": "^1.2.2"
  },

and

rm bun.lockb
rm -rf node_modules
bun install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants