jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.06k stars 215 forks source link

IndexedDB regression in WebWorkers #231

Open billiegoose opened 6 years ago

billiegoose commented 6 years ago

It may take me a while to get to the bottom of this; I've got a WebWorker that works fine with version 1.4.3:

importScripts('https://unpkg.com/browserfs@1.4.3/dist/browserfs.js')
BrowserFS.configure({
  fs: "IndexedDB",
  options: { }
}, (err) => ......

but silently fails to write files or create directories in version 2.0.0:

importScripts('https://unpkg.com/browserfs@2.0.0/dist/browserfs.js')
BrowserFS.configure({
  fs: "IndexedDB",
  options: { }
}, (err) => ......
jvilk commented 6 years ago

Oh, that's odd! I'll take a look when I have some free cycles.

btw, is the 2.0 code using a fresh database, or a version created with 1.4.3? (either design should work)

billiegoose commented 6 years ago

@isysd It was probably this one: https://github.com/wmhilton/wills-wonderful-service-worker

billiegoose commented 6 years ago

Actually that's not the exact one ,but that's close enough.

jcubic commented 4 years ago

Not sure if this is the same, but I got error

Error: ENOENT: No such file or directory., '/'
Error
    at new ApiError (https://cdn.jsdelivr.net/npm/browserfs@2.x.x/dist/browserfs.js:5430:22)
    at Function.FileError (https://cdn.jsdelivr.net/npm/browserfs@2.x.x/dist/browserfs.js:5455:16)
    at Function.ENOENT (https://cdn.jsdelivr.net/npm/browserfs@2.x.x/dist/browserfs.js:5458:21)
    at https://cdn.jsdelivr.net/npm/browserfs@2.x.x/dist/browserfs.js:13987:37
    at IDBRequest. (https://cdn.jsdelivr.net/npm/browserfs@2.x.x/dist/browserfs.js:14270:17)

When calling fs.readdir('/') inside service worker, outside everything works fine, I Have recursive function that list all the files with meta data, it work without problems in normal code.

It's been 2 years since this bug was created same as last commit, is this project maintained?

james-pre commented 8 months ago

Closing (stale). If you would like to reopen this issue, please do so by creating a new issue in the relevant repositories of @browser-fs