Using WASM in Solid(Start)
Hi. I have a SolidStart app that I'm running with Bun and what I want to do is embed WASM code into my solid app.
https://github.com/Industrial/skeleton-nodejs/blob/main/applications/solid-app/src/test.ts
This is an example of loading the WASM code (Haskell) and running a function. When I try to add that code to the https://github.com/Industrial/skeleton-nodejs/blob/main/applications/solid-app/src/app.tsx then I get the error:
4 Replies
I tried manually adding that package with
bun add -D
but get the same error.
Is there an official way of running WASM code in a SolidJS app?There are some issues with bun and solid.
Maybe you can try to use node and check if it still errors.
Let me try š
Hmm, I get this:
solid-app on ī main [!+?] via .NET via ī v22.5.1 via āļø impure (nix-shell-env) took 15s
āÆ npm install @rollup/rollup-linux-x64-musl
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @rollup/[email protected]: wanted {"os":"linux","cpu":"x64","libc":"musl"} (current: {"os":"linux","cpu":"x64","libc":null})
npm error notsup Valid os: linux
npm error notsup Actual os: linux
npm error notsup Valid cpu: x64
npm error notsup Actual cpu: x64
npm error notsup Valid libc: musl
npm error notsup Actual libc: null
npm error A complete log of this run can be found in: /home/tom/.npm/_logs/2024-08-25T11_17_56_304Z-debug-0.log
Looks like the wrong arch is detected by rollup
My proj (https://github.com/AlexErrant/Pentive/) has no problem with https://github.com/rhashimoto/wa-sqlite or https://github.com/open-spaced-repetition/fsrs-browser, the latter of which I built with wasm-bindgen. If you want a minimal project check out the sandbox of that project which is in Solid https://github.com/open-spaced-repetition/fsrs-browser/tree/main/sandbox . To be clear, I've not yet tried running WASM in solid start (or on the server) all my experience is with client-side wasm