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

Feedbdack on deprecation of router.handle #245

Open
ghost opened this issue May 14, 2024 · 4 comments
Open

Feedbdack on deprecation of router.handle #245

ghost opened this issue May 14, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation not a bug :) This is not a bug, or is expected behavior :)

Comments

@ghost
Copy link

ghost commented May 14, 2024

All the documentation everywhere on the Internet has router.handle

I spent an entire day trying to diagnose why my itty stuff wasn't working.

Eventually by chance I saw in the release notes:

router.fetch replaces router.handle

I don't know what can be done about this if anything but it sure cost me alot of time.

@kwhitley kwhitley added documentation Improvements or additions to documentation not a bug :) This is not a bug, or is expected behavior :) labels May 14, 2024
@kwhitley
Copy link
Owner

Yeah, sorry about that - we should probably make that change more in-your-face, since the low-byte nature of itty means there are no nice error messages or catches to guide users that slipped up or didn't catch the memo!

The Backstory

v0-v3 started with "handle" because that (still) makes more sense to me as it "handles" requests, but as more environments started settling on an exported "fetch" method (e.g. Workers, Bun, etc), v4 wasted the extra bytes to support both "fetch" and "handle"... and we reclaimed those bytes with the rest of the breaking changes in v5 by dropping legacy support for handle.

@ghost
Copy link
Author

ghost commented May 14, 2024

I understand, though breaking all the documentation for itty everywhere on the internet seems a fairly high price for those bytes.

@q351941406
Copy link

shit bro!!!! I am using Deno and want to deploy it to Cloudflare Workers. I can receive network requests using router.handle, but I cannot return a response. When I use router.fetch, it can return a response normally.This process wasted me 3 hours!!!!

@proddy
Copy link

proddy commented Dec 16, 2024

same happened to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation not a bug :) This is not a bug, or is expected behavior :)
Projects
None yet
Development

No branches or pull requests

3 participants