Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PouchDB did not sync docs with attachments #7727

Closed
nofear87 opened this issue Apr 15, 2019 · 3 comments
Closed

PouchDB did not sync docs with attachments #7727

nofear87 opened this issue Apr 15, 2019 · 3 comments

Comments

@nofear87
Copy link

nofear87 commented Apr 15, 2019

As soon as my doc has an attachments pouchdb did not sync it. As soons as I delete the attachment from doc via fauxton the sync is done correctly.

I always see a pending request to the relating database changes feed.

After enable debug I found the following:

pouchdb:api http://192.168.21.155:35986/jobs_9303 +64ms getAttachment error TypeError: response.buffer is not a function
at index-browser.es.js:7100
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391)
at Object.onInvoke (core.js:4749)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:141)
at zone.js:831
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)
at Object.onInvokeTask (core.js:4740)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:191)

I use V7.0 with CouchDB V2.3.0

@CharlesGrimont
Copy link

if you are using angular 6 & 7 or Ionic 4 you have to declare into your polyfill.ts the following code

(window as any).global = window;
(window as any).process = {};
(window as any).process.nextTick = setTimeout; 
window["browser"] = true;

This will prevent pouchDB from using response.buffer() and it will use repsonse.blob() instead.

@stale
Copy link

stale bot commented Jul 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 26, 2019
@stale stale bot closed this as completed Aug 2, 2019
garfieldnate added a commit to garfieldnate/pouchdb that referenced this issue Aug 3, 2019
response.buffer() is not supported at all, and blob.type is readonly in
ReactNative. Change the limited node/browser detection to (hopefully)
feature-proof feature detection instead.

Errors fixed in RN:

    Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not
    supported

    Cannot set property type of #<Blob> which has only a getter at

Fixes pouchdb#7688 and pouchdb#7727
garfieldnate added a commit to garfieldnate/pouchdb that referenced this issue Aug 3, 2019
response.buffer() is not supported at all, and blob.type is readonly in
ReactNative. Change the limited node/browser detection to (hopefully)
feature-proof feature detection instead.

Errors fixed in RN:

    Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not
    supported

    Cannot set property type of #<Blob> which has only a getter at

Fixes pouchdb#7688 and pouchdb#7727
garfieldnate added a commit to garfieldnate/pouchdb that referenced this issue Aug 5, 2019
response.buffer() is not supported at all, and blob.type is readonly in
ReactNative. Change the limited node/browser detection to (hopefully)
future-proof feature detection instead.

Errors fixed in RN:

    Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not
    supported

    Cannot set property type of #<Blob> which has only a getter at

Fixes pouchdb#7688 and pouchdb#7727
daleharvey pushed a commit that referenced this issue Aug 7, 2019
…eactNative

response.buffer() is not supported at all, and blob.type is readonly in
ReactNative. Change the limited node/browser detection to (hopefully)
future-proof feature detection instead.

Errors fixed in RN:

    Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not
    supported

    Cannot set property type of #<Blob> which has only a getter at

Fixes #7688 and #7727
@paolosanchi
Copy link
Contributor

paolosanchi commented Nov 17, 2019

instead of
window["browser"] = true;
i added this and worked:
(window as any).process.browser = true;
so the code that worked for me is this:

(window as any).global = window;
(window as any).process = {};
(window as any).process.nextTick = setTimeout;
(window as any).process.browser = true;

sto3psl pushed a commit to sto3psl/pouchdb that referenced this issue Mar 10, 2021
…ss in ReactNative

response.buffer() is not supported at all, and blob.type is readonly in
ReactNative. Change the limited node/browser detection to (hopefully)
future-proof feature detection instead.

Errors fixed in RN:

    Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not
    supported

    Cannot set property type of #<Blob> which has only a getter at

Fixes pouchdb#7688 and pouchdb#7727
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants