Skip to content

Node emitting a warning about the new Fetch API being an experimental feature #601

Open
@tasn

Description

@tasn

Node is emitting the following warning when using the Svix JavaScript API:

(node:11249) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time

It's harmless, but annoying.

What's going on?

Node added native support for fetch in node 18, though they marked it as experimental and show a warning when it's used.
Our libraries don't directly use it, but we use a 3rd party dependency that checks whether fetch exists, and if not, it overrides it. This means that we now use the native node fetch API on node 18, and thus trigger this warning.

How to fix?

  1. Find a way to silence this warning (as it's fine).
  2. Change to a dependency that deals with it already - though don't think such a thing exists.
  3. Override fetch on node even if it exists (so always use node-fetch).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglib/javascriptJavaScript client library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions