You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use parquet-wasm in my vite project but have been unable to initialize. Here is how I am trying to initialize, also I added the vite-plugin-wasm in my vite.config.ts. I get this error(Note I get the same thing with the await pattern):
Error initializing WebAssembly module: TypeError: WebAssembly.instantiate(): Import #0 "./parquet_wasm_bg.js": module is not an object or function
// Here is how I try to initialize
import wasmInit, { readParquet } from "parquet-wasm";
// Provide the correct URL for the WebAssembly file
const wasmUrl = new URL('../../node_modules/parquet-wasm/bundler/parquet_wasm_bg.wasm', import.meta.url).href;
// Initialize the WebAssembly module with the provided URL
wasmInit(wasmUrl).then(() => {
console.log("WebAssembly module initialized successfully");
}).catch((error) => {
console.error("Error initializing WebAssembly module:", error);
});
The text was updated successfully, but these errors were encountered:
You should inspect the traceback inside the generated parquet_wasm_bg.js, and perhaps put a breakpoint in the WebAssembly.instantiate call. Presumably the way you're passing in a local URL isn't supported by that WebAssembly.instantiate constructor.
No idea what the long term implications of this are, but adding the wasm plugin and excluding this package from optimization in my vite.config.js got me rolling. Sample vite.config.js:
import{defineConfig}from'vite';importwasmfrom'vite-plugin-wasm';exportdefaultdefineConfig({plugins: [wasm()],optimizeDeps: {exclude: ["parquet-wasm"]},// ... the rest of your config}
I would like to use parquet-wasm in my vite project but have been unable to initialize. Here is how I am trying to initialize, also I added the vite-plugin-wasm in my vite.config.ts. I get this error(Note I get the same thing with the await pattern):
Error initializing WebAssembly module: TypeError: WebAssembly.instantiate(): Import #0 "./parquet_wasm_bg.js": module is not an object or function
// Here is how I try to initialize
import wasmInit, { readParquet } from "parquet-wasm";
// Provide the correct URL for the WebAssembly file
const wasmUrl = new URL('../../node_modules/parquet-wasm/bundler/parquet_wasm_bg.wasm', import.meta.url).href;
// Initialize the WebAssembly module with the provided URL
wasmInit(wasmUrl).then(() => {
console.log("WebAssembly module initialized successfully");
}).catch((error) => {
console.error("Error initializing WebAssembly module:", error);
});
The text was updated successfully, but these errors were encountered: