holdenmatt / duckdb-wasm-kit

Hooks and utilities to make it easier to use duckdb-wasm in React apps.
https://www.npmjs.com/package/duckdb-wasm-kit
MIT License
101 stars 4 forks source link

getJsDelivrBundles is not a function #14

Closed stefanonardo closed 3 months ago

stefanonardo commented 4 months ago

Hello, I'm trying to create a duckdb with const { db, loading, error } = useDuckDb();, however it fails the initialization on const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles(); because duckdb is not imported properly but it's this object

default: "/static/media/duckdb-browser.e56a1ba9d486f1113bb3.cjs"
holdenmatt commented 3 months ago

Sorry for delay, are you still having this issue? I just updated to the latest dev build, so would be useful to know if it's still an issue after upgrading?

cspence001 commented 3 months ago

I'm having the same issue:

Uncaught (in promise) TypeError: duckdb.getJsDelivrBundles is not a function
    at initializeDuckDb.ts:38:1
    at Generator.next (<anonymous>)
    at sourceMaps.js:16:1
    at new Promise (<anonymous>)
    at __async (sourceMaps.js:16:1)
    at _initializeDuckDb (initializeDuckDb.ts:35:1)
    at initializeDuckDb.ts:25:1
    at Generator.next (<anonymous>)
    at sourceMaps.js:16:1
    at new Promise (<anonymous>)
holdenmatt commented 3 months ago

That's strange, I haven't been able to reproduce it. Can anyone share a minimal repro?

What bundler or framework are you using to import the library (e.g. nextjs, webpack, vite, etc)? I'm guessing that something isn't being imported right.

holdenmatt commented 3 months ago

Closing for now, but feel free to re-open if you can share a way to repro the issue.