Repository navigation
Vite doesn't seem to fallback to the WASM Rolldown on unsupported platforms #23691
Replies: 5 comments
|
In the details block at https://rolldown.rs/guide/getting-started#installation, there's some docs on getting the wasm build to work. You can try the steps there to get rolldown to use the WASM build as it doesn't install it by default. Alternatively, if you install Rolldown doesn't have prebuilt binaries for freebsd as it follows the supported platforms as node. |
|
Adding concrete steps for Mastodon's setup, since it uses Yarn (Berry). The WASM binding ( supportedArchitectures:
cpu:
- current
- wasm32Then run A few caveats:
|
|
Hi @community! When running on platforms without prebuilt native Rolldown binaries (such as OpenBSD): How to Force the WASM Fallback
npm install -D @rolldown/wasm
export ROLLDOWN_WASM=1
vite buildThis forces Vite to bypass native architecture checks and use the WebAssembly build directly. |
|
The official Rolldown installation guide documents a WASI fallback for platforms without a supported native binding. For Yarn Berry, check whether .yarnrc.yml includes the WASI architecture: supportedArchitectures:
os:
- current
- wasip1-threads
cpu:
- current
- wasm32Then reinstall dependencies and retry the build. Since this is an OpenBSD-specific setup, it would be worth confirming the exact behavior with the installed Rolldown version and Yarn configuration.
|
|
Rolldown doesn't ship a native OpenBSD binding, and the wasm fallback isn't automatic, the binding loader only picks it up when you force it. The workaround is installing the wasi binding yourself and setting an env var: It runs single threaded and noticeably slower, but for a Mastodon asset build that's fine. If it still tries to load the native binding, check which rolldown version your Vite 8 pins and install that exact version of the wasm binding. A version mismatch makes the loader skip it silently. — |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Hi,
First and foremost: a kind thank you for your hard work. I really appreciate it.
As you might be aware, Mastodon uses Vite to compile static assets. Exquisite.social is a Mastodon instance, powered by OpenBSD. Mastodon switched the
v4.6.xand later builds from Vite 7 to Vite 8. This added the Rolldown dependency which causes a problem for us.More specifically, upgrading and recompiling the static assets throws the following error:
In order to troubleshoot this issue, we have recently switched from Node 22 to Node 24 - removing the
node_modulesdirectory and rerunningyarn install. It does install fine, but as soon as the command is ran to precompile the static assets, the error above is thrown. According to the Rolldown documentation, it should automatically fallback to the WASM build.However, it does not seem to do so. Further troubleshooting and reading through the documentation haven't yielded any results. As versed as I am in backend architecture - I am pretty much a newbie when it comes to dealing with NodeJS etc.
Is there a possible override for
package.json? Previously we ran into somehwat compareble issues with Rollup and the fix that did work for us was:However, even after spending hours on troubleshooting this issue, I did not manage to find a solution for Rolldown - despite the issue llikely being PEBCAK.
Reproduction
https://raw.githubusercontent.com/mastodon/mastodon/refs/tags/v4.7.0/package.json
Steps to reproduce
No response
System Info
- OpenBSD 7.9-stable (and now OpenBSD 8.0-beta) - Node `node-24.19.0` - Different versions of Yarn and ViteUsed Package Manager
yarn
Logs
No response
Validations
All reactions