Skip to content

import parquet-wasm in vis dev server isn't working properly #12

@xinaesthete

Description

@xinaesthete

to reproduce

pnpm dev
go to localhost:5173 (or whichever port vite might have chosen for the vis demo server)
Try to activate one of the 'shapes' views in the SpatialCanvas

expected result

Shapes visualisation.

actual result

The loadShapesData function fails:

[ShapesRenderer] Failed to load shapes from https://storage.googleapis.com/vitessce-demo-data/spatialdata-august-2025/visium_hd_3.0.0.spatialdata.zarr/shapes/Visium_HD_Mouse_Small_Intestine_square_002um: CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 64 6f @+0

notes

It seems ok on the CI build - and also in the docs site running in dev server (but I was finding that less convenient for use during development as HMR doesn't work so fluidly - not that this is perfect in vis either).

Before it gets as far as this (indeed, before the user has really done anything that definitely means they need the parquet-wasm module to be loaded), we see this:

parquet_wasm.js:2760

`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:
 TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

Then the subsequent attempt to actually use it gets this:

CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 64 6f
ie. it's getting <document ... rather than the expected WASM magic word - so the whole thing really doesn't work in this context.

Briefly tried changing vite config to use vite-plugin-wasm or some custom middleware to set the MIME type for these requests but that didn't work (maybe in retrospect I was matching '.wasm' at the end of the URI but it was actually getting some vite cache parameter?)

Probably worth more thoroughly reviewing the parquet-wasm documentation for how best to import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions