BrowserFS
BrowserFS copied to clipboard
indexedDB inside MountableFileSystem require options
I had code like this:
BrowserFS.configure({
fs: 'MountableFileSystem',
options: {
'/': { fs: 'IndexedDB'},
'/tmp': { fs: 'InMemory' }
}
//fs: 'IndexedDB', options: {}
}, function(err) {
});
and it throw exception somewhere from browserfs, if I add opitons for indexedDB the error go away.
It should be documented that options is required.
Thanks for the note!
I suggest to fix the example in the README.md file ASAP, it's not cool if the very first example new users might run already throws an exception.
Also this is probably a bug and not a documentation issue. Looking at the notes for release 1.4.3:
Options object is optional for Create() methods when file system takes no options. Previously, the behavior was inconsistent. Now, calling Create(cb) is equivalent to calling Create({}, cb).
The exact error message for me is
Uncaught TypeError: Cannot read property 'storeName' of undefined
which to me sounds as if undefined
gets passed instead of {}
.
This bug is still reproducible at the time I'm writing this.
fwiw, still running into this
This is still an issue
Bumping @jvilk
Bumping @jvilk
use this
options: {
"/zip": {
fs: "ZipFS",
options: {
// Wrap as Buffer object.
zipData: Buffer.from(zipData)
}
},
"/tmp": { fs: "InMemory" },
"/home": { fs: "IndexedDB",
options: {
storeName : "mydata"
}
}
}
add
options: {
storeName : "mydata"
}
@killinux Your comment make no sense, in the original post I've added that options are required and it's not documented.
Still an issue, even if not inside MountableFileSystem. This works:
{ fs: "IndexedDB", options: { storeName: "your_name_here", }, },
Fixed in #352