Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make datx work with native fetch on node 20 / drop use of isomorphic-fetch #1208

Open
2 of 8 tasks
fvoska opened this issue Nov 29, 2023 · 0 comments
Open
2 of 8 tasks
Assignees

Comments

@fvoska
Copy link
Contributor

fvoska commented Nov 29, 2023

Relevant version

  • 0.x
  • 1.x
  • 2.x

Relevant libraries

  • utils
  • core
  • network
  • jsonapi
  • jsonapi-angular

Breaking change

No

Description

isomorphic-fetch is used both in DatX unit tests and in any apps that might use datx on server-side. This lib is 3 years old and I would not consider it safe for production, from security perspective.

In node 20, we have experimental native fetch API and it is stable in 21. We should look into using that for all apps that are running node >=21 (so I guess when we switch to 22 LTS would be the ideal time). I have tried using fetch on some app I am working on that runs datx unit tests in node and it does not work. Simply removing the use of fetch from isomorphic-fetch and using native fetch causes this error:

image

Note: jsonapi-angular is not affected, because there we connect fetchReference to Angular's HttpClient (which in the background uses native XHR in the browser and xhr2 in node)

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

No branches or pull requests

2 participants