I ran into a similar issue when upgrading my ionic7 project to ionic8.
I got it running again by forcing the sql.js version to be 1.11.0 in the package.json file
"dependencies": {
"sql.js": "1.11.0"
}
and then npm install --force
After that, copy the file node_modules/sql.js/dist/sql-wasm.wasm in your projects assets folder