Open
Description
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?
- Find a way to silence this warning (as it's fine).
- Change to a dependency that deals with it already - though don't think such a thing exists.
- Override fetch on node even if it exists (so always use node-fetch).