kylebarron / parquet-wasm

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

import with typescript #464

Closed MaTiAtSIE closed 2 months ago

MaTiAtSIE commented 4 months ago

Hi, I try to import parquet-wasm. However, it seems that the folder structure of the package does not match the README file. For instance the line

import * as parquet from 'parquet-wasm'

does not work as the compiler error says "Cannot find module 'parquet-wasm' or its corresponding type declarations" (tsc 4.9.5). I installed the package with

yarn add apache-arrow
yarn add parquet-wasm

After the installation, my typescript version was set to 4.5.5 and I manually reset the version to 4.9.5 by

yarn add typescript@4.9.5

The folder structure in {package_root}/node_modules/parquet-wasm is:

So "parquet-wasm/bundler/arrow1" does not exist. What can be the problem?

kylebarron commented 4 months ago

does not work as the compiler error says "Cannot find module 'parquet-wasm' or its corresponding type declarations" (tsc 4.9.5).

Can you either pin to the most recent stable version (i.e. 0.5.0) or try out this branch: https://github.com/kylebarron/parquet-wasm/pull/414? As mentioned here, the arrow2 implementation is no longer supported.

MaTiAtSIE commented 3 months ago

Thank you for the answer. Using the version 0.5.0 helped. I also had to enable 'asyncWebAssembly' in my webpack.config.js (webpack 5). Now I have another runtime issue which is documented here.

kylebarron commented 2 months ago

This should be fixed in 0.6.0, which was just published