Skip to content
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

duckdb_blocking createDuckDB Cannot read properties of undefined (reading 'mainModule') #1719

Open
seeya opened this issue Apr 26, 2024 · 0 comments

Comments

@seeya
Copy link

seeya commented Apr 26, 2024

What happens?

Initializing duckdb_blocking throws an undefined (reading 'mainModule') error.

To resolve it, I had to do this.

  let db = await duckdb_blocking.createDuckDB(
    **{ eh: DUCKDB_BUNDLES },**
    logger,
    duckdb_blocking.BROWSER_RUNTIME
  );

The issue should stem from here where it checks if the bundles.eh exists.

To Reproduce

I created a sandbox here: https://codesandbox.io/p/sandbox/bold-goldwasser-cgzhvv

import * as duckdb from "@duckdb/duckdb-wasm";
import * as duckdb_blocking from "@duckdb/duckdb-wasm/blocking";

async function instantiate(duckdb) {
  const JSDELIVR_BUNDLES = duckdb.getJsDelivrBundles();
  const DUCKDB_BUNDLES = await duckdb.selectBundle(JSDELIVR_BUNDLES);

  const logger = new duckdb_blocking.VoidLogger();
  let db = await duckdb_blocking.createDuckDB(
    **DUCKDB_BUNDLES**,
    logger,
    duckdb_blocking.BROWSER_RUNTIME
  );
  await db.instantiate((_) => {});

  return db;
}

Browser/Environment:

Chrome

Device:

macOS

DuckDB-Wasm Version:

1.28.0

DuckDB-Wasm Deployment:

browser

Full Name:

seeya

Affiliation:

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant