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

Why is query-string fixed to v5? This cause multiple query string in my final webapp bundle #548

Open
kopax-polyconseil opened this issue Aug 3, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@kopax-polyconseil
Copy link

kopax-polyconseil commented Aug 3, 2022

Expected Behavior

I expect one query-string module in my final web app bundle

Current Behavior

strict-uri-encode (Found 2 resolved, 2 installed, 2 depended. Latest 2.0.0.)
1.1.0 ~/strict-uri-encode
[email protected] -> amplitude-js@^8.16.1 -> query-string@5 -> strict-uri-encode@^1.0.0
2.0.0 /@react-navigation/core//strict-uri-encode
[email protected] -> @react-navigation/native@^6.0.6 -> @react-navigation/core@^6.1.0 -> query-string@^7.0.0 -> strict-uri-encode@^2.0.0

Possible Solution

Do not fix query string version and upgrade it to latest

Steps to Reproduce

Not necessary

Environment

  • JS SDK Version: 8.16.1
  • Installation Method: yarn
  • Browser and Version: chrome latest
@kopax-polyconseil kopax-polyconseil added the bug Something isn't working label Aug 3, 2022
@yuhao900914
Copy link
Contributor

Hi @kopax-polyconseil
Thanks for using our SDKs.
Using the @latest version for one package might also have the same issue because other packages which have the same dependency might not use the same criteria.
You can use the npm dedupe to reduce the duplication in the package tree. https://docs.npmjs.com/cli/v8/commands/npm-dedupe.
Hope this works.

@kopax-polyconseil
Copy link
Author

Thanks for your reply, problem here is that those package are not maintained anymore, perhaps an upgrade of the deps on all the dep tree would be the right move ? There's a reason why new versions come out, I hope you know it.

@kopax-polyconseil
Copy link
Author

@yuhao900914 also we use yarn, and

dka@dka:[~/workspace/github.com/pass-culture/pass-culture-app-native (PC-16624)]: yarn dedupe query-string
yarn dedupe v1.22.15
error The dedupe command isn't necessary. `yarn install` will already dedupe.
info Visit https://yarnpkg.com/en/docs/cli/dedupe for documentation about this command.
dka@dka:[~/workspace/github.com/pass-culture/pass-culture-app-native (PC-16624)]: ^C
dka@dka:[~/workspace/github.com/pass-culture/pass-culture-app-native (PC-16624)]: yarn dedupe --strategy highest
yarn dedupe v1.22.15
error The dedupe command isn't necessary. `yarn install` will already dedupe.
info Visit https://yarnpkg.com/en/docs/cli/dedupe for documentation about this command.
dka@dka:[~/workspace/github.com/pass-culture/pass-culture-app-native (PC-16624)]: yarn dedupe --check
yarn dedupe v1.22.15
error The dedupe command isn't necessary. `yarn install` will already dedupe.
info Visit https://yarnpkg.com/en/docs/cli/dedupe for documentation about this command.

@yuhao900914
Copy link
Contributor

yuhao900914 commented Aug 4, 2022

Hi @kopax-polyconseil
yarn install --flat is the equivalent to npm dedupe. yarn install does not dedupe the package very well.
Another workaround is to add a resolution in your package.json.
{
"name": "amplitude-js-demo",
"version": "0.1.0",
"private": true,
"resolutions": {
"query-string": "^7.1.1"
},
xxxx
}

The query-string@5 to the latest version has breaking changes. To support the older browser, we need to use query-string@5.

@kopax-polyconseil
Copy link
Author

Thanks for your reply, on a big project like ours yarn install --flat is a bit risky, I've had a try and it's almost all our dependency that will move. I am not willing to take this risk, it will touch our react native and also the web application, while I only want to optimize the web build. But thanks for offering.

I manage to solve the dedupe of this problem using webpack resolve alias, and I will have another try using the resolution :)

@k-mckinney
Copy link

Snyk jobs are now failing in our pipelines because of a downstream DoS vulnerability coming from a dependency in query-string:

This has been fixed in v0.2.2 of decode-uri-component, and that's used in v7.1.3 of query-string, but if this project is pinned to v5 of query-string that vulnerability will continue to exist.

@guncebektas
Copy link

same issue at 8.21.4, setting "amplitude-js": "8.21.3" in package.json removes the error

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