Skip to content
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

Cannot import parquet-wasm/bundler #529

Open
stefanonardo opened this issue Apr 30, 2024 · 3 comments
Open

Cannot import parquet-wasm/bundler #529

stefanonardo opened this issue Apr 30, 2024 · 3 comments

Comments

@stefanonardo
Copy link

stefanonardo commented Apr 30, 2024

hello, I'm trying to use the bundler build with CRACO/Webpack. This is my webpack config (inside the CRACO one):

    plugins: {
      add: [new WasmPackPlugin({ crateDirectory: __dirname })],
    },

I get this error from Webpack:

Rust compilation.
ERROR in Rust compilation.

webpack compiled with 1 error

There is no other output about it, but I guess it refers to this error that appears during the compilation:

Error: crate directory is missing a `Cargo.toml` file; is `.` the wrong directory?

Also, import { ParquetFile } from 'parquet-wasm/bundler'; causes Cannot find module 'parquet-wasm/bundler' or its corresponding type declarations.. Instead, if I use the parquet-wasm entrypoint the Typescript server allows me to see the correct types of the library.

@kylebarron
Copy link
Owner

There is no other output about it, but I guess it refers to this error that appears during the compilation:

That's weird... why is it trying to compile the Rust code from source?

I haven't used craco or webpack myself, so I don't know the configuration to get it to work with them. I usually use the node or esm entry points myself.

Also, import { ParquetFile } from 'parquet-wasm/bundler'; causes Cannot find module 'parquet-wasm/bundler' or its corresponding type declarations.. Instead, if I use the parquet-wasm entrypoint the Typescript server allows me to see the correct types of the library.

Hmm. Perhaps this is an error in how the conditional entry points are defined? I don't know what's wrong with this export though:

"./bundler": {
"types": "./bundler/parquet_wasm.d.ts",
"default": "./bundler/parquet_wasm.js"
},

@H-Plus-Time
Copy link
Contributor

@stefanonardo Can you post the relevant pieces of your tsconfig.json (namely module, moduleResolution), and versions of typescript, webpack and (most importantly) parquet-wasm?

@stefanonardo
Copy link
Author

stefanonardo commented Sep 10, 2024

"module": "esnext",
"moduleResolution": "node"
"typescript": "5.1"
"craco": "6.4.5"
"parquet-wasm": "0.6.0"
"webpack": "5.72.1"

I uninstalled it though, I can't give you more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants