Skip to content

Use node's fetch instead of cross-fetch #23

Closed

Description

@li-yechao

As following warning message, node-domexception is deprecated, it is a nested dependency of node-fetch (node-fetch also is a dependency of cross-fetch). Since node original support fetch since v18, can we remove cross-fetch/node-fetch polyfill, use node's original fetch instead?

npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
      @libsql/client 0.15.9
      └─┬ @libsql/hrana-client 0.7.0
        └─┬ node-fetch 3.3.2
          ├─┬ fetch-blob 3.2.0
          │ └── node-domexception 1.0.0
          └─┬ formdata-polyfill 4.0.10
            └─┬ fetch-blob 3.2.0
              └── node-domexception 1.0.0

Activity

  1. jrmajor commented on Aug 10, 2025

    @jrmajor

    node-fetch also requires web-streams-polyfill, which is a very large package (8.62 MB).

    @libsql/client 0.15.10
    └─┬ @libsql/hrana-client 0.7.0
      └─┬ node-fetch 3.3.2
        ├─┬ fetch-blob 3.2.0
        │ └── web-streams-polyfill 3.3.3
        └─┬ formdata-polyfill 4.0.10
          └─┬ fetch-blob 3.2.0
            └── web-streams-polyfill 3.3.3
    
  2. jpc-ae commented on Dec 5, 2025

    @jpc-ae

    +1 to this. Will a pull request help, or is this part of the client no longer being maintained?

  3. kenn commented on Feb 16, 2026

    @kenn

    +1 to remove loud punycode warning.

    (node:18871) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    

    The root cause is the same cross-fetch

    @libsql/client → @libsql/hrana-client → cross-fetch → node-fetch → whatwg-url → tr46@0.0.3
    

    tr46@0.0.3 (from 2016) does require("punycode") which triggers the Node.js deprecation warning. It's the Turso/LibSQL database client that ultimately pulls it in.

  4. MMMikeM commented on Mar 27, 2026

    @MMMikeM

    @honzasp @penberg is this something you're open to? Anything I could do to assist?

  5. honzasp commented on Mar 28, 2026

    @honzasp
    Contributor

    Hello, I haven't been working on this for more than 2 years, but @penberg might be able to assist you :)

  6. MMMikeM commented on Mar 28, 2026

    @MMMikeM

    Hello, I haven't been working on this for more than 2 years, but @penberg might be able to assist you :)

    Sorry for the tag Jan, I decided them based on highest contributions 😅

  7. added a commit that references this issue on Apr 15, 2026
    c39a3da
  8. adutton commented on Apr 15, 2026

    @adutton
    Contributor

    I created a PR #27 to remove the cross-fetch dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions