kylebarron / parquet-wasm

Rust-based WebAssembly bindings to read and write Apache Parquet data
https://kylebarron.dev/parquet-wasm/
Apache License 2.0
483 stars 19 forks source link

bundler version doesn't work in production since 0.4.0-beta.5 #396

Closed Sheap closed 5 months ago

Sheap commented 7 months ago

When trying to read a parquet file in any version since 0.4.0-beta.5, I get an error that wasm is undefined, but only in production builds. Running on a dev server works fine. I'm using vite, with vite-plugin-wasm and vite-plugin-top-level-await

Sheap commented 7 months ago

If anybody has the same issue, I found a workaround in using the esm bundle. To make this work in vite, you need to add

optimizeDeps: {
  ...
  exclude: ['parquet-wasm/esm/arrow2'],
}

to your vite.config.ts

kylebarron commented 7 months ago

This is probably related to an underlying wasm-bindgen upgrade. I don't think it's anything I changed myself.

kylebarron commented 5 months ago

This is likely to be an issue with vite and rust-wasm in general, and it doesn't seem that I'm doing anything wrong, so I'll close.