Open
Description
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
import Nano from "nano";
const nano = Nano({url: "my-CouchDB-url", requestDefaults: {timeout: 120_000}});
const databaseList = await nano.db.list();
I receive the error:
Adapter 'http' is not available in the build
Seems the error is generated by axios
and seems the solution is to move to fetch
. There is a possible workaround at axios/axios#5523 but setting agent
in the requestDefaults
has no effect.
Possible Solution
- scrap axios and use fetch :-)
- document a way to change axios adapter from outside. Agent option seems that does not change anything.
Steps to Reproduce (for bugs)
- Create an Electron application
- In the main.js (that is, the Node process) add the lines listed above (putting a known CouchDB url).
- Run
npm run dev
- See the error
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
- Version used: 10.1.2
- Browser Name and version: Electron 26.0.0 that runs Node 18.16.1. Not run in browser.
- Operating System and version (desktop or mobile): Windows 11 64bits desktop
- Link to your project: Not public
Metadata
Metadata
Assignees
Labels
No labels