apache / couchdb-nano

Nano: The official Apache CouchDB library for Node.js
https://www.npmjs.com/package/nano
Apache License 2.0
653 stars 165 forks source link

New Axios-based cookie support has side-effects because of axios-cookiejar-support #254

Open dsebastien opened 3 years ago

dsebastien commented 3 years ago

I'm cross-posting this issue here just to let you know that the new usage of axios-cookiejar-support has side effects on unrelated code. As I've described here (https://github.com/auth0/node-jwks-rsa/issues/215), I'm using node-jwks-rsa, which also uses Axios as client. Unfortunately, since nano includes axios-cookiejar-support, it seems that the way node-jwks-rsa uses Axios does not work anymore.

I imagine that they could change the way they use Axios, but it's rather surprising to see such side-effects. Note that it's not an issue with nano per se, but I thought it might be interesting to make it appear here too, in case others stumble upon such problems.

Expected Behavior

No side-effects with Axios.

Current Behavior

Axios breaks when used in certain ways because of the presence of axios-cookiejar-support.

Possible Solution

Fix of axios-cookiejar-support & upgrade of nano (maybe it should also be a peer dependency?)

Steps to Reproduce (for bugs)

Your Environment

mlegenhausen commented 3 years ago

Same problem. Please don't monkey patch dependencies!

gallak87 commented 3 years ago

Same problem here, an upstream dependency fabric-common that uses nano, ends up breaking some of our nestjs downstream deps that require httpService (which uses axios)