cloudflare worker fails with some parameters that ethers.js harcode
See original GitHub issuecloudflare worker mimic the behavior of a service worker, as such it is like a limited browser environment.
unfortunately it does not implement all parameters of the fetch
api making it fails with ethers.js due to these lines:
While the redirect
field works, the other do not and I get a respective error for each:
The 'credentials' field on 'RequestInitializerDict' is not implemented.
The 'cache' field on 'RequestInitializerDict' is not implemented.
The 'mode' field on 'RequestInitializerDict' is not implemented.
The 'referrer' field on 'RequestInitializerDict' is not implemented.
Would be great if we could override the default behavior here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:21 (8 by maintainers)
Top Results From Across the Web
error: could not detect network (event="nonetwork", code ...
cloudflare worker fails with some parameters that ethers.js harcode ... Github.com. Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, ...
Read more >JS Error in Cloudflare Workers - Getting Started
Hi, I'm new to Cloudflare Workers. How do I add the below JavaScript into Cloudflare Workers? It shows me an error.
Read more >RxJS in Action.pdf
Error handling with RxJS 182. PART 3 MASTERING RXJS 209. 8 □. Heating up observables 211. 9 □. Toward testable, reactive programs 245....
Read more >A Government-Backed Cryptocurrency for Universal Basic ...
In this project an Ether-backed UBI token has been created to solve this problem. The system has been built using smart contracts (see...
Read more >Highlights ethers.js: March 2022 - RicMoo
The latest minor version has just been released with some exciting new ... out the problem with ethers in the Cloudflare Worker environment, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now available in v5.6. I’ve tried it out and am loving Cloudflare Workers.
To use it, connect to your provider setting the
skipFetchSetup
flag:Let me know if you have any issues!
@wighawag Wow, thank you! I am using webpack and this is my webpack config, based on your suggestion:
I needed to install
string-replace-loader
webpack loader and everything worked out of the box, amazing.Thank you @wighawag and thank you @ricmoo for the amazing package.