jaydenseric / apollo-upload-client

A terminating Apollo Link for Apollo Client that fetches a GraphQL multipart request if the GraphQL variables contain files (by default FileList, File, or Blob instances), or else fetches a regular GraphQL POST or GET request (depending on the config and GraphQL operation).
https://npm.im/apollo-upload-client
1.53k stars 156 forks source link

Update peer dependency for @apollo/client #291

Closed sibelly closed 2 years ago

sibelly commented 2 years ago

I need to use @apollo/client@3.7.0-alpha.3, because of this issue here -> https://github.com/apollographql/apollo-client/issues/9668

But the apollo-upload-client is breaking when I do a npm install

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: @apollo/client@3.7.0-alpha.3
npm ERR! node_modules/@apollo/client
npm ERR!   @apollo/client@"^3.7.0-alpha.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @apollo/client@"^3.0.0" from apollo-upload-client@17.0.0
npm ERR! node_modules/apollo-upload-client
npm ERR!   apollo-upload-client@"^17.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/user/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2022-05-10T13_37_31_006Z-debug-0.log

Versions:

"apollo-upload-client": "^17.0.0",
"@apollo/client": "^3.7.0-alpha.3",
"graphql": "^15.8.0",
"react": "17.0.2",
"react-native": "0.68.1",
"expo": "~45.0.0",
jaydenseric commented 2 years ago

Maybe try deleting node_modules and package-lock.json, then run npm install --force, and see if it works? Verify only one version of @apollo/client is installed by running npm ls @apollo/client.

sibelly commented 2 years ago

Thank you for the quick reply @jaydenseric.

This is the output for npm ls @apollo/client:

investor-app@ /home/user/Documentos/legagreen/investor-app
├── @apollo/client@3.7.0-alpha.3
└─┬ apollo-upload-client@17.0.0
  └── @apollo/client@3.7.0-alpha.3 deduped invalid: "^3.0.0" from node_modules/apollo-upload-client

npm ERR! code ELSPROBLEMS
npm ERR! invalid: @apollo/client@3.7.0-alpha.3 /home/user/Documentos/legagreen/investor-app/node_modules/@apollo/client

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2022-05-10T15_35_28_652Z-debug-0.log

I tested the app here and worked fine, thanks for the --force tip, I don't like it, but solves by now.