-
Notifications
You must be signed in to change notification settings - Fork 19
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
issue using esm or bundled versions of parquet-wasm using esbuild #488
Comments
when I run
If you look at the generated bindings, you can see if (typeof input === 'undefined') {
input = new URL('parquet_wasm_bg.wasm', import.meta.url);
} in the
I can't find this function in the generated bindings in the latest bundler build. You should try one the latest beta.
So presumably |
Thanks @kylebarron, I was able to get it to work in the following way and would appreciate any advice: I am using the
Since parquet-wasm was working correctly with file that was obtained from unpkg, I figured I would download the file (https://unpkg.com/[email protected]/esm/arrow2.js), save it locally to
I was still getting the URL error so I added a console log to the
However, this did not work on Google Colab and Terra.bio - probably because we can't rely on Jupyter hosting files. So I figured I would try to hardwire the WASM file into the JavaScript by converting it to a Base64 string. I saved this string to a file called
and imported it into the init function on my local copy of
This approach seems to be working locally and on Google Colab and Terra.bio. Do you think this is a reasonable approach? If so, would it make sense to include the WASM code as a base64 string in the esm version? |
Hi, I am seeing errors when I try to import parquet-wasm using the bundler esbuild.
Similar to this issue, #486, I am seeing this error
when I import parquet-wasm like this
without awaiting the default function. However, when I run
await pq.default()
, I see this errorIf I try to switch to using the bundler build like this
(which required using the wasmLoader for esbuild and setting the target for esnext to enable top-level await) I get this error
and clicking LC (8a312991-81c6-426e-b14c-067bcbe5f62b:1553:10554) shows
For some background, I'm using parquet-wasm in an anywidget that is being bundled with esbuild on the suggestion from this discussion. Also, the
await pq.default()
function works properly if use a CDN to obtain parquet-wasm like thisimport * as pq from "https://unpkg.com/[email protected]/esm/arrow2.js";
The text was updated successfully, but these errors were encountered: