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

🐛 BUG: checkedFetch does not support global fetch function which is Proxied #3478

Closed
evanderkoogh opened this issue Jun 16, 2023 · 0 comments · Fixed by #3497
Closed

🐛 BUG: checkedFetch does not support global fetch function which is Proxied #3478

evanderkoogh opened this issue Jun 16, 2023 · 0 comments · Fixed by #3497
Labels
bug Something that isn't working

Comments

@evanderkoogh
Copy link
Contributor

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

3.1.0

What operating system are you using?

Mac

Describe the Bug

I am working on an open telemetry library, which needs to proxy the fetch function to intercept the request/response and modify the request out. This works great in production, but when wrangler is in development mode, wrangler substitutes references to the global fetch function with the checkedFetch function with the esbuild define functionality.

This seems to lead to situations where checkedFetch and the proxied fetch keep calling each other.

Would there be any objections to changing the checkedFetch functionality from a substitution to JS Proxy as well? That should work much more reliably. Happy to submit a PR for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants