Closed rmylb closed 3 years ago
Just to give another feedback: Same issue here with nano v9.0.3. Downgrade to v8.2.3 works.
I also ran into this regression in multipart attachment support when I tried to update nano in couchdb-push. I'll use 8.2 for the time being. But I really like the switch to axios and the minimal dependency footprint, this is really awesome work!
I tried to debug the issue, but without much luck.
There is a test for this, but it shows a false positive. The request is nocked here but doesn't test the attachment request body sent.
I tried running the testsuite locally with NOCK_OFF=true
but that seems not supported anymore? I see there is a hardcoded couchdb url, so it won't work against a Couch v3 (admin party has been removed from couch > 2). So I tried running it against couch v2 and also couch v1.7.2, but the testsuite fails with a lot of tests and I aborted it.
Next thing I tried was running the attachment test alone, with
NOCK_OFF=true npx jest --env node test/multipart.insert.test.js
and it throws Database does not exist.
Looks like there's some setup code gone.
Looking at the code, the multipart data is added to the request, which is later passed to axios. But there seems no handling of multipart data in axios.
So from what I understand is needed is to manually construct the multipart body. In the browser, this can be done via FormData
and in node possibly with the form-data package.
I have same problem with version 9.0.3 - downgrade to version 8.2.3 solve the issue
The problem still has not been resolved in version 9.0.4 . I get same error during upload multipart insert downgrading to version 8 will solve this issue @jo Johannes Jörg Schmidt https://github.com/jo/nano-option/pull/22
Fixed in nano@9.0.5
Expected Behavior
Insert doc and attachment(s) in the db with the
db.multipart.insert
function as described in docs.Current Behavior
Error return
and
Steps to Reproduce (for bugs)
Your Environment
Edit : I've downgrade to version 8.2.3 and is ok, but the version 9.0.0 and 9.0.1 aren't.