tursodatabase / tursodatabase/libsql-client-ts
BUG: Fail to import @libsql/client in node < 18
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 576
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
Hello there!
According to the docs, it's compatible with node version 12 or later. But it seems to fail in node 16 as I ran into an error when importing @libsql/client or @libsql/client/web:
.../node_modules/@libsql/isomorphic-fetch/node.cjs:3
const _Request = Request;
^
ReferenceError: Request is not defined
Upon searching, almost all answers seem to suggest upgrading to node 18.
For now, I can take advantage of using libsql-js instead, but it seems like it doesn't support returning rows in array form https://github.com/tursodatabase/libsql-js/issues/116. Would love to learn to resolve these issues! :)
Note: @libsql/client/sqlite3 works fine, but I feel like it only supports file based or :memory: database?
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 reproducing the import of @libsql/client and @libsql/client/web under Node 16, then compare it with the working @libsql/client/sqlite3 entry point. Inspect the reported failure in @libsql/isomorphic-fetch/node.cjs and verify that the documented Node 12+ compatibility works without the ReferenceError; preserve the behavior noted for sqlite3.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100