-
Notifications
You must be signed in to change notification settings - Fork 133
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
SNOW-897216: Package should declare dependency on asn1.js #624
Comments
hi and thank you for raising this issue and appreciate the detailed explanation! i wanted to see for myself but I'm obviously missing something, because I could not reproduce in a
# node -v
v18.16.1
# curl -fsSL https://get.pnpm.io/install.sh | bash -
==> Downloading pnpm binaries 8.6.12
..gets installed..
# pnpm install snowflake-sdk
WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.1.0: 16.38 kB/10.87 MB
WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
Packages: +221
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
Content-addressable store is at: /root/.local/share/pnpm/store/v3
Virtual store is at: node_modules/.pnpm
Progress: resolved 221, reused 0, downloaded 221, added 221, done
dependencies:
+ snowflake-sdk 1.7.0
Downloading registry.npmjs.org/aws-sdk/2.1441.0: 10.87 MB/10.87 MB, done
Done in 7.8s
# pnpm why asn1.js
Legend: production dependency, optional only, dev only
/node
dependencies:
snowflake-sdk 1.7.0
├─┬ @techteamer/ocsp 1.0.0
│ ├── asn1.js 5.4.1
│ ├─┬ asn1.js-rfc2560 5.0.1
│ │ ├── asn1.js 5.4.1 peer
│ │ └─┬ asn1.js-rfc5280 3.0.0
│ │ └── asn1.js 5.4.1
│ └─┬ asn1.js-rfc5280 3.0.0
│ └── asn1.js 5.4.1
├─┬ asn1.js-rfc2560 5.0.1
│ ├── asn1.js 5.4.1 peer
│ └─┬ asn1.js-rfc5280 3.0.0
│ └── asn1.js 5.4.1
└─┬ asn1.js-rfc5280 3.0.0
└── asn1.js 5.4.1 even with can you perhaps provide the reproduction steps or what other setting i need to look at ? thank you in advance ! |
Hi @sfc-gh-dszmolka thanks for taking a look! In my original post I said that using My actual repro steps are.
This is what I see in the node_modules directory afterwards: I'm actually unsure at this point whether this would be considered a bug in yarn itself, though it does seem intuitively correct to me that it shouldn't satisfy a peer requirement of one package with a subdependency of another |
thank you @ajwootto ; makes sense and of course thanks to your repro, it easily reproduces for me as well. As an interim solution, I could avoid the warning (and also, get "devDependencies": {
"asn1.js": "^5.0.0", <<< new line added
"async": "^3.2.3", perhaps it can be used as a workaround. Anyways, we'll take a look. |
@sfc-gh-dszmolka glad you could get a repro! I don't think adding it to devDependencies will fix the issue though since as far as I know it's being used at runtime, so I think it needs to go in dependencies. |
well, for me adding
# ls -la node_modules/asn*
lrwxrwxrwx 1 root root 56 Aug 23 06:49 node_modules/asn1.js -> .store/asn1.js-npm-5.4.1-37c7edbcb0/node_modules/asn1.js
lrwxrwxrwx 1 root root 70 Aug 23 06:49 node_modules/asn1.js-rfc2560 -> .store/asn1.js-rfc2560-virtual-6cae34e700/node_modules/asn1.js-rfc2560
lrwxrwxrwx 1 root root 72 Aug 23 06:49 node_modules/asn1.js-rfc5280 -> .store/asn1.js-rfc5280-npm-3.0.0-5b944d0cac/node_modules/asn1.js-rfc5280 we're discussing this internally how we would like to address this behaviour and I'll keep this Issue updated on the outcome. |
I was able to work around this by adding the following to my packageExtensions:
snowflake-sdk@*:
dependencies:
"asn1.js": "^5.0.0" # https://github.com/snowflakedb/snowflake-connector-nodejs/issues/624 |
PR with the fix: #654 |
PR is merged and will be part of the October release, expected towards end of October. |
node.js driver version 1.9.1 released with the fix and is available on npm. thank you all for bearing with us ! |
I'm still seeing this issue with the version 1.9.1 when I remove my above workaround.
|
the snowflake-sdk package declares peerDependency on asn1.js , as mentioned in previous comments
meaning after a long discussion (as i remember it) the decision was to rely on the project which uses |
So the installation instructions should be updated to include this as well? |
What version of NodeJS driver are you using?
1.7.0
What operating system and processor architecture are you using?
Mac OS Apple Silicon
What version of NodeJS are you using?
(
node --version
andnpm --version
)18.16
Installing this package using a stricter package manager such as
pnpm
or yarn inpnpm
mode will result in an error from theasn1.js-rfc2560
dependency when it attempts to resolveasn1.js
. This is because theasn1.js-rfc2560
package declares asn1.js as a peerDependency, but this package does not supply it with one. The reason this works fine in regularnpm
installs is because the other asn1-related dependency this package asks for (asn1.js-rfc5280
) declares a direct dependency onasn1.js
. It is then installed, and withnpm
it gets "hoisted" to the root ofnode_modules/
allowing the other package with the peer dependency to find it.pnpm
does not allow this type of hoisting, so this package needs to declare a direct dependency onasn1.js
in order to work.The text was updated successfully, but these errors were encountered: