Conversation
…8d88eb5b019c2949bda86565528) (#22) Co-authored-by: jurerotar <28565137+jurerotar@users.noreply.github.com>
|
All tests still fail. Is this ready to merge despite? |
|
Seems like @vapier's |
|
@sgbeal, sorry to bother you! Any ideas on this pipeline failing? Has SAHPool's init changed? |
|
haha crazy that someone used my vapier/http-server fork. I deleted it once my PRs were (finally) merged back into the canonical http-party/http-server. they sadly haven't made a new release, but if you're simply looking for cors support, you should be able to pin to that project now to get the functionality you need. |
|
This part is curious: SAHPool does not load |
|
BTW: there's a new mechanism which can be used to force the library to not load "opfs" or "opfs-wl": https://sqlite.org/wasm/doc/trunk/cookbook.md#disable-vfs That will keep it from loading |
|
Here's the relevant test code: sqlite-wasm/src/__tests__/workers/sqlite3-sahpool.worker.js Lines 5 to 7 in 29a59fe This worker is invoked here: sqlite-wasm/src/__tests__/sqlite3-sahpool-vfs.browser.test.js Lines 3 to 9 in 29a59fe I haven't changed the tests at all in this PR, so it appears that the way to use SAHPool has changed now. This test is also based on real-life usage. If you inspect the test, you'll see that we don't try to manually load This appears to be a breaking change from the last version we published, so we'll either need to add a migration guide, or add a patch upstream so that existing way still works. @sgbeal, please advise on how to approach this one. |
The error is being triggered not from SAHPool, but from the external file i'm unable to reproduce this with the upstream code so am at a loss as to what is trying to load the async proxy without the proper URI parameters. That worker is loaded from precisely one place upstream and always includes the required arguments (which are new in 3.53 but this file has always been an internal detail, not part of the public API, so clients aren't loading it manually). The relevant part is: const options = opfsUtil.options;
let proxyUri = options.proxyUri +(
(options.proxyUri.indexOf('?')<0) ? '?' : '&'
)+'vfs='+vfsName;
//sqlite3.config.error("proxyUri",options.proxyUri, (new Error()));
const W = opfsVfs.worker =
//#if target:es6-bundler-friendly
(()=>{
/* _Sigh_... */
switch(vfsName){
case 'opfs':
return new Worker(new URL("sqlite3-opfs-async-proxy.js?vfs=opfs", import.meta.url));
case 'opfs-wl':
return new Worker(new URL("sqlite3-opfs-async-proxy.js?vfs=opfs-wl", import.meta.url));
}
})();
//#elif target:es6-module
new Worker(new URL(proxyUri, import.meta.url));
//#else
new Worker(proxyUri);
//#/ifMy assumption is that the bundler-friendly mechanism is to blame, but i've no way to confirm that in the upstream tree. Both the vanilla and non-bundler ESM modes are tested in several apps upstream and do not reproduce this. i unfortunately don't currently have any ideas about how to resolve this. |
No description provided.