As reported in PouchDB:
apache/pouchdb#7819
apache/pouchdb#7825
apache/pouchdb#7848
I narrowed-down the bug to the leveldown transition from version 5.0.2 to 5.0.3 (ALL other package versions are latest, currently levelup = 4.3.2, pouchdb-adapter-leveldb = 7.1.1, pouchdb-adapter-leveldb = 7.1.1, etc.)
In other words, ONLY leveldown needs to be pinned to version 5.0.2. In my case, the package.json looks like:
"optionalDependencies": {
"leveldown": "5.0.2",
"pouchdb-adapter-leveldb": "^7.1.1"
},
"resolutions": {
"leveldown": "5.0.2"
}
LevelDown diff between version 5.0.2 and 5.0.3:
v5.0.2...v5.0.3
Note my app stacktrace:
Uncaught Exception:
Error: once called more than once
at /project/node_modules/pouchdb-core/node_modules/pouchdb-utils/lib/index.js:88:13
at /project/node_modules/argsarray/index.js:14:18
at /project/node_modules/pouchdb-core/lib/index.js:769:14
at /project/dist/node_modules/pouchdb-adapter-leveldb-core/lib/index.js:350:18
at /project/dist/node_modules/argsarray/index.js:14:18
at /project/dist/node_modules/pouchdb-adapter-leveldb-core/lib/index.js:429:16
at /project/dist/node_modules/sublevel-pouchdb/lib/index.js:243:9
at /project/dist/node_modules/sublevel-pouchdb/lib/index.js:74:13
So, I am not certain that the problem actually stems from the leveldown implementation, but I thought I'd post this here as well as in the PouchDB issue tracker, just in case somebody here has a clue as to why the leveldown code change introduced in version 5.0.3 trips the PouchDB LevelDB adapter.
I should point out that my app is built with Electron version 6.0.12 (NodeJS 12), but I had the exact same problem with earlier Electron/NodeJS versions. LevelDown is built with npm rebuild --runtime=electron --target=6.0.12 --disturl=https://atom.io/download/atom-shell --build-from-source.
Thank you!