pygame-web / pygbag

python and pygame wasm for everyone ( packager + test server + simulator )
https://github.com/pygame-web
MIT License
295 stars 34 forks source link

BrowserFS.InMemory is undefined error in Firefox #129

Open christislord12 opened 8 months ago

christislord12 commented 8 months ago

On first load of a pygbag project in Firefox it gives a BrowserFS.InMemory error. After reloading the page twice, the error does not happen and the project loads. This error does not occur in Safari or Opera.

Screenshot 2023-10-26 at 3 30 07 PM
Memopentagone commented 7 months ago

yeah can confirm it is happening on Firefox but also appears to be happening on ios with safari

pmp-p commented 7 months ago

[long term decision] is to drop BrowserFS and use Panda3D vfs instead. There's no drop-in replacement for it i can see right now ( zipfs+overlayfs ) so not worth the work.

If anyone find something close please drop a note. Basically BrowserFS is a Node FS emulator ( with added complexity) like the one emscripten provides

pmp-p commented 4 months ago

They are moving to https://github.com/browser-fs and now i don't even know how to load emscripten fs now ( it there's still any)

Javascript bundlers world seems as simple as python packaging so help very welcome here.

https://github.com/browser-fs/core/issues/22#event-12035817310

james-pre commented 2 months ago

Hi @pmp-p and @christislord12, I'm the maintainer of BrowserFS. BrowserFS has been deprecated. Please see the notice in the readme at https://github.com/jvilk/browserfs for more info.

Would you be interested in updating your project to use the updated fork, ZenFS?

Support for Emscripten is pending on DefinitelyTyped#69218.

pmp-p commented 2 months ago

Would you be interested in updating your project to use the updated fork, ZenFS?

I would be very interested if support for overlayfs emscripten/WASM-OPFS is coming. If not i cannot justify time to make the switch :(

currently pygbag only use : zipfs + overlayed memfs

the next move would be to get user file persistence > 5 MiB for distributed applications otherwise localStorage still does the job.

james-pre commented 2 months ago

@pmp-p,

OPFS is already available with the WebAccess backend, provided as part of @zenfs/dom. As I mentioned before, I'm waiting for the PR to merge before releasing the Emscripten backend. I expect it to be released one to two weeks after the PR is merged.