Open crystalfp opened 1 year ago
Seems already have a pull request here https://github.com/apache/couchdb-nano/pull/314
Yes there's a branch that replaces axios with fetch, but haven't got round to merging it yet. It would be great if you could test it i.e replace your nano dependency with something like github.com/apache/couchdb-nano#fetch
On Wed, 23 Aug 2023 at 07:56, Mario Valle @.***> wrote:
Seems already have a pull request here #314 https://github.com/apache/couchdb-nano/pull/314
— Reply to this email directly, view it on GitHub https://github.com/apache/couchdb-nano/issues/332#issuecomment-1689386258, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFKMROWFWNAXLDWDSOP663XWWSTLANCNFSM6AAAAAA32636AQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
With pleasure, @glynnbird !
Simply overwrote the package directory with the fetch branch content (Bad bad!).
Besides installing undici
and removing requestDefaults
at least the opening of the database succeeded. Now I could continue with porting and testing.
Have a great day!
mario
Dear @glynnbird , the modified version works perfectly (at least in my application)! I hope soon will be release as the official nano version. Currently every time I install a package, the nano package reverts to the official version and I have to overwrite it again with your "fetch" branch. Thanks again! mario
I have the same error
@MiniSuperDev The workaround until the nano package will be updated is to do:
npm i "https://github.com/apache/couchdb-nano#fetch"
Now magically the application works. Hope it heps mario
Any news about merging the change in the main distribution? Thanks!
Waiting on the official release also because the suggested way to set options elicit an error in Typescript:
import undici from "undici";
const undiciOptions = new undici.Agent({bodyTimeout: 120_000});
const db = Nano({url: databaseURL, agentOptions: undiciOptions});
The strange error on agentOptions
is:
Type 'Agent' is not assignable to type 'typeof Agent | typeof Dispatcher | AgentOptions | typeof MockAgent | undefined'.
Type 'Agent' is missing the following properties from type 'typeof MockAgent': prototype, getEventListeners, addAbortListener, errorMonitor, and 5 more.ts(2322)
Thanks for looking! mario
Expected Behavior
Used nano without errors under Node 20.4.0. I want to use the exactly same code under Electron that bundles Node 18.16.1
Current Behavior
At the first call to nano
I receive the error:
Seems the error is generated by
axios
and seems the solution is to move tofetch
. There is a possible workaround at https://github.com/axios/axios/issues/5523 but settingagent
in therequestDefaults
has no effect.Possible Solution
1) scrap axios and use fetch :-) 2) document a way to change axios adapter from outside. Agent option seems that does not change anything.
Steps to Reproduce (for bugs)
npm run dev
Context
Well, this problem blocks entirely my porting of the client-server application under Electron. If there is no solution I have to scrap CouchDB and move to another DB.
Your Environment