-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't install and load spatial extension #1542
Comments
The shell is using |
Thanks, @domoritz ! But it doesn't look like it's available on npm for now. I guess I am too impatient! It's a great addition to be able to use extensions. :) https://www.npmjs.com/package/@duckdb/duckdb-wasm?activeTab=versions |
I need to review why CI had not pushed a new version on npm, I will update when it's out. |
Can you give it a try with the latest package on npm: It should work while hosting it locally. Edit: adding some details, it will not work out of the box just changing the line above since jsdelivr has not (yet?) hosted the proper resources, but it should be doable if you host them together with the index.html that you have. |
Hi! So...
I guess something went wrong when publishing on npm... |
I checked this on npm as well, 1.28.0 is 71.9 MB (https://www.npmjs.com/package/@duckdb/duckdb-wasm/v/1.28.0), 1.28.1-dev65.0 is 1.63 GB which is more than 20 times as much. Seems like this can't be correct even with more exposed functions... |
I think this should be solved, jsdelivr is back online: https://www.jsdelivr.com/package/npm/@duckdb/duckdb-wasm. Serving this file works now as intended (no errors shown): <!DOCTYPE html>
<html>
<body>
<script type="module">
import * as duckdb from "https://cdn.jsdelivr.net/npm/@duckdb/duckdb-wasm@1.28.1-dev91.0/+esm";
const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
// Select a bundle based on browser checks
const bundle = await duckdb.selectBundle(JSDELIVR_BUNDLES);
const worker_url = URL.createObjectURL(
new Blob([`importScripts("${bundle.mainWorker}");`], {
type: "text/javascript",
})
);
// Instantiate the asynchronus version of DuckDB-wasm
const worker = new Worker(worker_url);
const logger = new duckdb.ConsoleLogger();
const db = new duckdb.AsyncDuckDB(logger, worker);
await db.instantiate(bundle.mainModule, bundle.pthreadWorker);
URL.revokeObjectURL(worker_url);
const conn = await db.connect();
await conn.query(`INSTALL spatial; LOAD spatial;`);
</script>
</body>
</html> |
Thanks for the patience, and see the discussion here: #1561 for more background informations. |
Wonderful! Thanks, @carlopi! |
What happens?
When trying to reproduce the example from Extension for DuckDB-Wasm, I couldn't install and load the spatial extension.
Here's the error:
To Reproduce
Here's the code I used. You can copy and paste it into an HTML file and open it with a browser.
Browser/Environment:
Version 120.0.6099.109 (Official Build) (arm64)
Device:
MacBoork PRO m1
DuckDB-Wasm Version:
1.28.0
DuckDB-Wasm Deployment:
html page
Full Name:
Nael Shiab
Affiliation:
CBC/Radio-Canada
The text was updated successfully, but these errors were encountered: