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

Change from Axios to Fetch API to support Serverless Workers. #10

Open
tmikaeld opened this issue Jul 21, 2020 · 1 comment
Open

Change from Axios to Fetch API to support Serverless Workers. #10

tmikaeld opened this issue Jul 21, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@tmikaeld
Copy link

tmikaeld commented Jul 21, 2020

This would be extremely useful in non-node based Serverless functions, but since you rely on Axios, that is not possible.

See more here: https://community.cloudflare.com/t/can-i-use-axios-in-a-worker/168139

You can change to node-fetch to support fetch in Node until it's there natively.

Luckily, fetch is very mature and easy to use, so switching from Axios to Fetch API should be very easy possible.

@tmikaeld tmikaeld changed the title Please change from Axios to Fetch API. Change from Axios to Fetch API to support Serverless Workers. Jul 21, 2020
@tmikaeld
Copy link
Author

It's because there's no Fetch adapter in Axios yet.

axios/axios#1219

Currently, Axios uses XHR which isn't supported in Cloudflare Workers, it's also old and has a lot of issues...

More here too:

contentful/contentful.js#396

@alekshs alekshs added the enhancement New feature or request label Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants