sqlite / sqlite-wasm

SQLite Wasm conveniently wrapped as an ES Module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timeout while waiting for OPFS async proxy worker

cquillen2003 opened this issue · comments

In Safari (v16.6.1), the OPFS is not working for me, but it works in Chrome. I am getting the following warning in Safari:

[Warning] Ignoring inability to install OPFS sqlite3_vfs: – "Timeout while waiting for OPFS async proxy worker." (sqlite3.mjs, line 11795)

If memory serves correctly (which it might not), the fix for that particular bug was not included in 16.x. There was a problem with the OPFS APIs not being accessible to a sub-worker, but i don't have a bookmark to the ticket.

You can instead use the new (as of 3.43) OPFS SAH Pool VFS:

https://sqlite.org/wasm/doc/trunk/persistence.md#vfs-opfs-sahpool

That one will work with any of the Big Three browsers released after approximately March 2023. However, it has certain trade-offs which might make it unfeasible for some clients (namely a completely lack of multi-tab concurrency).

How to do that via npm is a mystery to me, however.

Here's the offending ticket:

https://bugs.webkit.org/show_bug.cgi?id=255458

To the best of my understanding, that was was not applied to any 16.x releases.

A few more details about it can be found at:

https://sqlite.org/wasm/doc/trunk/persistence.md#vfs-opfs-safari

For npm, just be sure to depend on a version 3.43.1-build1 (current right now) and higher.