"fetch" api included in NodeJS v18 brokes sql.js
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting sql-wasm.js, especially the fetch check shown in the issue, and compare its behavior under NodeJS 18. Determine how the NodeJS environment should load the wasm file when a global fetch function exists. Done means sql.js works correctly in NodeJS 18 without incorrectly trying to fetch the wasm file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, sqlite, wasm
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100