Skip to content

The error this.emit is not a function has been raised while local storage has changed from other windows. #8581

@vrtmrz

Description

@vrtmrz

Issue

Hi, team! I am always thankful to you for this grateful and excellent database!

I noticed that the error that I wrote in the title became shown on the browser. (It happens both with using pouchdb-browser and custom build from the core and some required plugins.). After I checked some behaviour and realise a concern, therefore I made a patch.
The reference to this looks has been captured in the function at packages/node_modules/pouchdb-utils/src/changesHandler.js.

I made the patch and tested it, and looks like works fine.

Would you mind if I make make a pull request?

Info

  • Environment: Browser
  • Platform: Chrome
  • Adapter: idb
  • Server: N/A

Reproduce

  1. Open two windows of pouchdb.com
  2. Open devTools in both windows. perform localStorage.setItem("Hello", World")
  3. The error appears in the opposite window.

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