-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Sync attachments from CouchDB : Error in fetchData function response.buffer() not a function #7688
Comments
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. |
Hi ! Any update about this ?????? Why its marked as wontfix ? Thank you ! |
See #7727 |
Hi, I haven't tried the solution of #7727 that posts @sansato. I think it will works.. I don't know I'm kind of newbie in pouchdb so maybe you people know better about this kind of changes.. Anyway, just want to help the community.. |
Add a check for ReactNative next to the checks for node/browsers so that we don't throw errors using unsupported API's. Fixes pouchdb#7688.
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
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
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
…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
…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
Issue
Sync with attachments fails-->
fetchData throws error at calling response.buffer()
Info
Reproduce
To reproduce this issue you have to follow this steps:
3 Call PouchDB.replicate.to ionic app to replicate document to Remote CouchDB
4 Erase PouchDB on Android
5 Replicate to new PouchDB the documents with attachments from CouchDB
I found this on the code
function fetchData(filename) {
var att = atts[filename];
var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +
'?rev=' + doc._rev;
return ourFetch(genDBUrl(host, path)).then(function (response) {
if (typeof process !== 'undefined' && !process.browser) {
return response.buffer();
} else {
/* istanbul ignore next */
return response.blob();
}
So I solve this issue on my environment by forcing the response to be a blob(), I don't know if this could be a problem in other platforms, but for Ionic it works.
Also had to change (remove) some code that has a TODO comment, // TODO: Can we remove this?
For me this solve everything, my app is working fine but I think you should check that part so we can have a official working version of PouchDB for Ionic 4.
Hope I can help you in the future.
The text was updated successfully, but these errors were encountered: