I have created a separate repo in StackBlitz for reproduction of this bug. Strangely now it has a new exception when running vitest on Microsoft Edge for Windows (version 132.0.2957.106), while having ERR_DLOPEN_DISABLED on Chrome for Android (version 126.0.6478.122) when building the app.
You can view and download it here. Would work in a native Node.js environment.
After removing package-lock.json and creating it again with npm i I have solved the problem.