-
Notifications
You must be signed in to change notification settings - Fork 130
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
apache-arrow marked as external dependency #345
Comments
Thanks for trying it out! Bundling duckdb-wasm is less straight-forward than I anticipated due to currently broken bundles of apache-arrow 6.0.0. I'll add examples for the different bundlers as soon as we get arrow 6.0.1. |
Thanks for the quick response @ankoh! Let me know if you'd like any assistance with documentation or examples when 6.0.1 lands. |
@hamilton here's the esbuild build script I'm using to build with a working version of apache-arrow, not sure exactly how to do it in rollup though |
Also looking forward to this. Looks like 6.0.1 just released? https://github.com/apache/arrow/releases/tag/apache-arrow-6.0.1 |
Apache Arrow is now at 6.0.1 on NPM. |
I still am not able to build against it, I tried removing my hack and it didn’t work |
So you installed the pre-released version 0.1.13-dev8.0 with
and imported DuckDB-Wasm using only:
? |
Yes, here's a repro with esbuild. From a fresh directory:
how did you get that to build with esbuild? |
I did manage to get rid of |
but then actually using the build fails, the browser console gives:
|
With es build, you may need apache/arrow#11742. I'll try to get it released soon. |
Not sure if its useful. But I tried to use it in an Angular project now, and get build errors: (using @duckdb/duckdb-wasm@0.1.13-dev8.0, and import * as duckdb from '@duckdb/duckdb-wasm'; `Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/duckdb_module.d.ts:1:23 - error TS2688: Cannot find type definition file for 'emscripten'. 1 /// Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/duckdb_module.d.ts:6:39 - error TS2304: Cannot find name 'EmscriptenModule'. 6 export interface DuckDBModule extends EmscriptenModule { Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/duckdb_module.d.ts:7:23 - error TS2304: Cannot find name 'stackSave'. 7 stackSave: typeof stackSave; Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/duckdb_module.d.ts:8:24 - error TS2304: Cannot find name 'stackAlloc'. 8 stackAlloc: typeof stackAlloc; Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/duckdb_module.d.ts:9:26 - error TS2304: Cannot find name 'stackRestore'. 9 stackRestore: typeof stackRestore; Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/duckdb_module.d.ts:10:19 - error TS2304: Cannot find name 'ccall'. 10 ccall: typeof ccall; Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/runtime.d.ts:1:23 - error TS2688: Cannot find type definition file for 'emscripten'. 1 /// Error: node_modules/@duckdb/duckdb-wasm/dist/types/src/bindings/runtime.d.ts:27:87 - error TS2503: Cannot find namespace 'Emscripten'. 27 export declare function callSRet(mod: DuckDBModule, funcName: string, argTypes: Array<Emscripten.JSType>, args: Array): [number, number, number]; etc. |
Our benchmarks are built against the esm using esbuild but they are on node, so it works there. |
@peder1001 in the meantime, you could use |
Also, we're using this tiny hack with esbuild to fix the issue with the arrow exports: |
Thanks ankoh, and now its more back to apache-arrow, so I will have to try to figure it out.. Error: node_modules/apache-arrow/Arrow.d.ts:54:466 - error TS2304: Cannot find name 'ReadableStreamReadValueResult'. I guess your tiny hack will solve it, just need to figure out what it does and implement it in the angular compiler |
@peder1001 @hamilton @llimllib You can read more about the current bundles here: duckdb-wasm/packages/duckdb-wasm/bundle.mjs Lines 9 to 36 in 51329ad
The problems with apache-arrow are defused for now by bundling apache-arrow into the browser (esm) bundles. Here are very basic examples for: I'll extend the list soon. |
DuckDB-Wasm now ships with a more fine granular export map. duckdb-wasm/packages/duckdb-wasm/package.json Lines 84 to 132 in 51329ad
In most scenarios, a simple Our main browser bundles are esm, our worker scripts are iife, our node bundles are commonjs. |
This is great @ankoh ! Will be very helpful to people getting started |
tested it in my app and I was able to remove the name resolution hack, this is great |
Closing this for now. @hamilton let me know if the problem persists. |
Thanks @ankoh! Will be trying now, and probably time to turn back on my GH notifications :) |
Hello folks ~
So thrilled to experiment w/
duckdb-wasm
! Thank you for all your hard work.I'm having a bit of trouble bundling duckdb-wasm in a simple case. I'm using Rollup and opting for the simplest possible input file:
But rollup produces this error:
Here is a repository that hopefully reproduces this (including my rollup file, includes instructions): https://github.com/hamilton/duckdb-wasm-issues
Is there something obvious that I'm missing here? (There usually is!)
The text was updated successfully, but these errors were encountered: