pouchdb-community / worker-pouch

Easy way to use PouchDB inside a Web Worker or Service Worker
Apache License 2.0
217 stars 35 forks source link

update dist to fix ServiceWorker #42

Closed msenevir closed 6 years ago

msenevir commented 6 years ago

In lib/client/core.js, line 33 checks for a valid worker with:

if (!worker || (!worker.postMessage && (!worker.controller || !worker.controller.postMessage))) {

However, in dist/pouchdb.worker-pouch.js, the check is:

if (!worker || !worker.postMessage) {

This means that ServiceWorkers (which rely on controller.postMessage) will be incorrectly marked as invalid. I fixed this by running npm run build so the distributed package is up-to-date

garethbowen commented 6 years ago

Deprecated in favour of https://github.com/pouchdb-community/worker-pouch/pull/46