Skip to content

pouchdb-adapter-memory requires Node modules #9117

@Arlen22

Description

@Arlen22

After installing [email protected] and [email protected] and attempting to build with esbuild, I'm getting these errors. The [email protected] package appears to be responsible. As far as I'm aware, this is supposed to be usable in the browser, at least according to NPM.

✘ [ERROR] Could not resolve "util"

    client/node_modules/levelup/lib/levelup.js:2:23:
      2 │ var inherits = require('util').inherits
        ╵                        ~~~~~~

  The package "util" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Could not resolve "stream"

    client/node_modules/sublevel-pouchdb/node_modules/readable-stream/readable.js:2:25:
      2 │ exports.Stream = require('stream');
        ╵                          ~~~~~~~~

  The package "stream" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Could not resolve "assert"

    client/node_modules/levelup/lib/levelup.js:9:21:
      9 │ var assert = require('assert')
        ╵                      ~~~~~~~~

  The package "assert" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Could not resolve "stream"

    client/node_modules/sublevel-pouchdb/node_modules/readable-stream/lib/_stream_writable.js:40:21:
      40 │ var Stream = require('stream');
         ╵                      ~~~~~~~~

  The package "stream" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Could not resolve "stream"

    client/node_modules/sublevel-pouchdb/node_modules/readable-stream/lib/_stream_readable.js:43:21:
      43 │ var Stream = require('stream');
         ╵                      ~~~~~~~~

  The package "stream" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

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