-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"fetch" api included in NodeJS v18 brokes sql.js #528
Comments
This is a good catch, but this is an emscripten issue, isn't it ? All we can do is update to a more recent emscripten when they fix the bug, right ? |
I'm having a perhaps related strange error: Error: Aborted(RuntimeError: Aborted(Error: ENOENT: no such file or directory, open 'http:/localhost:8000/sql-wasm.wasm'). Build with -sASSERTIONS for more info.). Build with -sASSERTIONS for more info.
❯ E node_modules/sql.js/dist/sql-wasm.js:101:154
❯ node_modules/sql.js/dist/sql-wasm.js:158:425 Trying to serve a custom EDIT: using sql.js version 1.7.0 fixed this for me. Also, staying with node version 18 rather than 16. |
Can confirm this is fixed. Works for me on sql.js 1.8.0 and Node 19.2.0 |
NodeJS 18 includes experiential support for the "fetch" api. This is causing sql.js not to work properly after Node v18. Because it checks if there is an global "fetch" funcion exists. If so it tries to fetch the wasm file.
sql-wasm.js
.... "function"!=typeof fetch?c(b):fetch(P,{credentials:"same-origin"}) .....
This check is invalid for NodeJS v18.
The text was updated successfully, but these errors were encountered: