pouchdb-community / worker-pouch

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

Error Failed to Execute 'PostMessage' #12

Closed ronycohen closed 8 years ago

ronycohen commented 8 years ago

When Getting some data the cloning is not possible on the worker side.

image

ronycohen commented 8 years ago

I solved my issue with a cloning of the doc before saving into the worker DB.

nolanlawson commented 8 years ago

Yes, objects cannot be cloned if they have functions inside of them. PouchDB ignores this; worker-pouch throws an error when this happens.

ronycohen commented 8 years ago

In my case I just did a _.clone(device) in order to make it work.