Skip to content

Outdated sublevel-pouchdb dependency should be superceded by subleveldown? #7929

@danielweck

Description

@danielweck

This issue arised from a separate issue regarding PouchDB + LevelDown on MacOS (which forces developers to pin leveldown to version 5.0.2), see Level/leveldown#686 => as you can see, there are 3 references to the PouchDB issue tracker, as the problem is likely to be located in one of the PouchDB packages. The crash stacktrace includes a reference to sublevel-pouchdb:

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

...thus this new issue: the pouchdb-adapter-leveldb-core package currently depends on sublevel-pouchdb. Here is an interesting comment made by @vweevers in the LevelDown project:
Level/leveldown#686 (comment)

sublevel-pouchdb is outdated, as it was forked from level-sublevel which is no longer maintained and is known to have several compatibility issues with latest level* modules. The preferred solution is now subleveldown.

Are the PouchDB project maintainers aware of this?

PS: I must admit not finding direct references to sublevel-pouchdb in the PouchDB package.json:

https://github.com/pouchdb/pouchdb/blob/7.1.1/package.json

...yet my app's package-lock.json clearly references it:

    "pouchdb-adapter-leveldb-core": {
      "version": "7.1.1",
      "resolved": "https://registry.npmjs.org/pouchdb-adapter-leveldb-core/-/pouchdb-adapter-leveldb-core-7.1.1.tgz",
      "integrity": "sha512-+R0cHiqS1fF8QjjqZ02RMj70nbUetl2MvWq3rr1ml1IdGwmR3XfEgvs3zyojmn6WrwpW7Dka89s8FPfP5YG3SA==",
      "requires": {
        "argsarray": "0.0.1",
        "buffer-from": "1.1.0",
        "double-ended-queue": "2.1.0-0",
        "levelup": "4.0.2",
        "pouchdb-adapter-utils": "7.1.1",
        "pouchdb-binary-utils": "7.1.1",
        "pouchdb-collections": "7.1.1",
        "pouchdb-errors": "7.1.1",
        "pouchdb-json": "7.1.1",
        "pouchdb-md5": "7.1.1",
        "pouchdb-merge": "7.1.1",
        "pouchdb-utils": "7.1.1",
        "sublevel-pouchdb": "7.1.1",
        "through2": "3.0.1"
      },
      "dependencies": {
        "abstract-leveldown": {
          "version": "6.0.3",
          "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz",
          "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==",
          "requires": {
            "level-concat-iterator": "~2.0.0",
            "xtend": "~4.0.0"
          }
        },
        "deferred-leveldown": {
          "version": "5.0.1",
          "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.1.tgz",
          "integrity": "sha512-BXohsvTedWOLkj2n/TY+yqVlrCWa2Zs8LSxh3uCAgFOru7/pjxKyZAexGa1j83BaKloER4PqUyQ9rGPJLt9bqA==",
          "requires": {
            "abstract-leveldown": "~6.0.0",
            "inherits": "^2.0.3"
          }
        },
        "levelup": {
          "version": "4.0.2",
          "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.2.tgz",
          "integrity": "sha512-cx9PmLENwbGA3svWBEbeO2HazpOSOYSXH4VA+ahVpYyurvD+SDSfURl29VBY2qgyk+Vfy2dJd71SBRckj/EZVA==",
          "requires": {
            "deferred-leveldown": "~5.0.0",
            "level-errors": "~2.0.0",
            "level-iterator-stream": "~4.0.0",
            "xtend": "~4.0.0"
          }
        }
      }
    },

...and cat node_modules/sublevel-pouchdb/package.json:

{
  "_from": "sublevel-pouchdb@7.1.1",
  "_id": "sublevel-pouchdb@7.1.1",
  "_inBundle": false,
  "_integrity": "sha512-7egqKyyiTknLzTGcvijpqmLL9qx2unPVze02e/4pTnpSI0G0c0EblLv7jj1Nt7h0/P/5MNCvIr1+dMzgjgvc5Q==",
  "_location": "/sublevel-pouchdb",
  "_phantomChildren": {
    "core-util-is": "1.0.2",
    "isarray": "0.0.1"
  },
  "_requested": {
    "type": "version",
    "registry": true,
    "raw": "sublevel-pouchdb@7.1.1",
    "name": "sublevel-pouchdb",
    "escapedName": "sublevel-pouchdb",
    "rawSpec": "7.1.1",
    "saveSpec": null,
    "fetchSpec": "7.1.1"
  },
  "_requiredBy": [
    "/pouchdb-adapter-leveldb-core"
  ],
  "_resolved": "https://registry.npmjs.org/sublevel-pouchdb/-/sublevel-pouchdb-7.1.1.tgz",
  "_shasum": "46feb7efe0dc3697a7b1b35169699972d54c2328",
  "_spec": "sublevel-pouchdb@7.1.1",
  "_where": "/Volumes/500GB/Code/readium-desktop/node_modules/pouchdb-adapter-leveldb-core",
  "author": {
    "name": "Dale Harvey",
    "email": "dale@arandomurl.com"
  },
  "bugs": {
    "url": "https://github.com/pouchdb/pouchdb/issues"
  },
  "bundleDependencies": false,
  "contributors": [
    {
      "name": "Dominic Tarr",
      "email": "dominic.tarr@gmail.com"
    }
  ],
  "dependencies": {
    "inherits": "2.0.3",
    "level-codec": "9.0.1",
    "ltgt": "2.2.1",
    "readable-stream": "1.0.33"
  },
  "deprecated": false,
  "description": "Fork of level-sublevel with ony the subset of the API that PouchDB uses",
  "files": [
    "lib",
    "dist",
    "tonic-example.js"
  ],
  "homepage": "https://github.com/pouchdb/pouchdb#readme",
  "jsnext:main": "./lib/index.es.js",
  "keywords": [],
  "license": "Apache-2.0",
  "main": "./lib/index.js",
  "module": "./lib/index.es.js",
  "name": "sublevel-pouchdb",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/pouchdb/pouchdb.git"
  },
  "version": "7.1.1"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions