You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling targetDB.load(sourceString) results in an error of readableStream.pipe is not a function.
mm.pdb.pouch = new PouchDB('pdb', {revs_limits: 20,adapter: 'cordova-sqlite'});
// Receive zip file from server, extract it into a text file, then
mm.pdb.pouch.load(dbDumpTxt
).then(function(r){
console.log('Loaded from file!');
mm.pdb.initSyncing();
}).catch(function(e){
console.error('Could not restore from file, proceeding with normal sync. Message:',e.message);
});
I can use pouchdb-load with the same dbDumpTxt file, but it seems to cause a slew of network activity following the .load (even with proper proxy option supplied), so I'm trying to see if pouchdb-replication-stream's .load() is better.
Has anyone else run into this .pipe() issue?
Looks like it's because .load() expects a STREAM, not a STRING. I've just dug into learning about streams (Node.js, BufferedStreams, HighLander, mozilla developer versiosn), and it looks like they are slightly different. Any chance that this .load() function could be modified to also accept an input string, as that is what .dump() creates?
The text was updated successfully, but these errors were encountered:
cepm-nate
changed the title
Getting 'readableStream.pipe' is not a function, in the console
Getting 'readableStream.pipe' is not a function
Jan 25, 2018
cepm-nate
changed the title
Getting 'readableStream.pipe' is not a function
Error: 'readableStream.pipe' is not a function (when using in a browser)
Jan 25, 2018
cepm-nate
changed the title
Error: 'readableStream.pipe' is not a function (when using in a browser)
Give .load() the ability to accept strings
Jan 25, 2018
Old thread, but this needs clarification. They probably should have clarified this in the ReadMe but this can only work server-side (node.js) since javascript has no ability to save files on the client side. Based on your code, it looks like you were trying to use this for an app (as I was when I came across the library) but it won't work without a server-side connection to store files. Unless somebody knows of some magic I don't.
PouchDB and pouchdb-replication-stream included via script tags at top of page.
Calling
targetDB.load(sourceString)
results in an error ofreadableStream.pipe is not a function
.I can use pouchdb-load with the same dbDumpTxt file, but it seems to cause a slew of network activity following the .load (even with proper proxy option supplied), so I'm trying to see if pouchdb-replication-stream's .load() is better.
Has anyone else run into this .pipe() issue?
Looks like it's because .load() expects a STREAM, not a STRING. I've just dug into learning about streams (Node.js, BufferedStreams, HighLander, mozilla developer versiosn), and it looks like they are slightly different. Any chance that this .load() function could be modified to also accept an input string, as that is what .dump() creates?
The text was updated successfully, but these errors were encountered: