You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mongodb has dependencies that are not listed as peer dependencies. I tried to use packageExtensions to get around this but I am now getting dozens more errors from two libraries Snappy and @mongodb-js/zstd.
➤ YN0000: in ../../.yarn/cache/@mongodb-js-zstd-npm-1.0.0-1751370982-73e82a30be.zip/node_modules/@mongodb-js/zstd/index.js 89:28-70
➤ YN0000: Module not found: Error: Can't resolve './zstd.linux-arm-gnueabihf.node' in '/Users/sigex/workdir/backend/lambda/.yarn/cache/@mongodb-js-zstd-npm-1.0.0-1751370982-73e82a30be.zip/node_modules/@mongodb-js/zstd'
➤ YN0000: in ../../.yarn/cache/snappy-npm-7.1.2-2cf48206bf-7381485fdd.zip/node_modules/snappy/index.js 1:622-662
➤ YN0000: Module not found: Error: Can't resolve '@napi-rs/snappy-android-arm64' in '/Users/sigex/workdir/backend/lambda/.yarn/cache/snappy-npm-7.1.2-2cf48206bf-7381485fdd.zip/node_modules/snappy'
It looks like it's trying to require all these different binaries for different machines.
My packageExtensions is below and it's managed to get most of the warnings to shut up.
Mongodb has created 3 PRs to "support PnP", but have written no documentation. But this issue is not specific to them, it is more about how we handle libraries that have missing peer dependencies that happen to be binaries.
Yarn skips linking incompatible dependencies so your bundler is unable to locate them.
To fix this issue you can either change which packages are linked with supportedArchitectures, change your bundler to avoid trying to bundle them, or avoid using native dependencies.
Self-service
Describe the bug
Mongodb has dependencies that are not listed as peer dependencies. I tried to use
packageExtensions
to get around this but I am now getting dozens more errors from two libraries Snappy and @mongodb-js/zstd.It looks like it's trying to require all these different binaries for different machines.
My
packageExtensions
is below and it's managed to get most of the warnings to shut up.To reproduce
I created a repo here, see branch
mongodb-broken-pnp
.https://github.com/gruckion/yarn-berry-serverless-workspaces/tree/mongodb-broken-pnp
Run
yarn; yarn package
to reproduce the errors.Environment
System: OS: macOS 13.0 CPU: (10) arm64 Apple M1 Max Binaries: Node: 16.13.2 - /private/var/folders/mv/dtw39jks6ml64s3pd1pnv_640000gn/T/xfs-7dfef409/node Yarn: 3.2.3 - /private/var/folders/mv/dtw39jks6ml64s3pd1pnv_640000gn/T/xfs-7dfef409/yarn npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Additional context
Mongodb has created 3 PRs to "support PnP", but have written no documentation. But this issue is not specific to them, it is more about how we handle libraries that have missing peer dependencies that happen to be binaries.
https://github.com/mongodb/node-mongodb-native/pulls?q=pnp
I also posted a comment on this PR as Mongodb and Mongodb'sissue section on Jira and on Snappy's library
mongodb/node-mongodb-native#2606
https://jira.mongodb.org/browse/NODE-4659
Brooooooklyn/snappy#93
I am also using
pnp-webpack-plugin
The text was updated successfully, but these errors were encountered: