duckdb / duckdb-wasm

WebAssembly version of DuckDB
https://shell.duckdb.org
MIT License
1.02k stars 110 forks source link

Getting `Uncaught Error: Table type not specified` when integrating in a nextjs project #1704

Open saikatmitra91 opened 2 months ago

saikatmitra91 commented 2 months ago

What happens?

I just installed duckdb-wasm in my next js project and tried importing JSON.

I keep getting Uncaught Error: Table type not specified

I saw it's not loading JSON extension wasm file at all. when I use a similar query on shell.duckdb.org, it works ! and JSON extension file is downloaded too.

I might be missing something here.

Please recommend what I need to do in order to mitigate the issue

To Reproduce

Sample code: https://github.com/empirical-run/empirical/pull/116/files

Browser/Environment:

Chrome latest

Device:

macos

DuckDB-Wasm Version:

1.28.1-dev106.0

DuckDB-Wasm Deployment:

NA

Full Name:

Saikat Mitra

Affiliation:

www.empirical.run

carlopi commented 2 months ago

Can you try issue an explicit "LOAD json" on the conn object after this line: const conn = await db.connect(); ?

saikatmitra91 commented 2 months ago

sure let me check and get back

dude0001 commented 2 months ago

Is the error referring to an Arrow Table that DuckDB connections returns results in? Do you need to add the dependency for the apache-arrow package?