-
I'm trying to get duckdb-wasm to load its files from my CDN (a Digital Ocean Spaces CDN), and failing. Here is a regular This shows that CORS is enabled for the file, but it's still not working with duckdb-wasm. I think that the issue may be that the request from duckdb-wasm is not sending the
You can see that the response does not include an
Given that I can't modify the server here, is there anything that can be done on the duckdb side to make the request with an Any other ideas for things I can try are welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The dilemma here is likely, that the creation of cross-origin workers requires some workaround. I added a tiny helper for that purpose in @duckdb/[email protected]. import * as duckdb from "@duckdb/duckdb-wasm"
const workerScript = "https://cdn.billmill.org/nbastats/dist/duckdb/duckdb-browser.worker.js";
const worker = await duckdb.createWorker(workerScript); I would, however, recommend to use the jsdelivr bundles since we have multiple workers to get most out of different client browsers. const allBundles = duckdb.getJsDelivrBundles();
const bestBundle = await duckdb.selectBundle(allBundles);
const worker = await duckdb.createWorker(bestBundle.mainWorker); |
Beta Was this translation helpful? Give feedback.
The dilemma here is likely, that the creation of cross-origin workers requires some workaround.
(More information here: https://stackoverflow.com/questions/21913673/execute-web-worker-from-different-origin)
I added a tiny helper for that purpose in @duckdb/[email protected].
I would, however, recommend to use the jsdelivr bundles since we have multiple workers to get most out of different client browsers.