BUG: Fail to import @libsql/client in node < 18
azmy60 opened this issue · comments
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 tursodatabase/libsql-js#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?
I guess the docs should be updated as node >= 18 is mentioned in the @libsql/isomorphic-fetch
(here).
This is a bit weird because the package isomorphic-fetch
is generally used for backward compatibility 😅