TheKaiser
CDCloudflare Developers
•Created by TheKaiser on 8/31/2023 in #workers-help
How do i send data from worker to durable object fetch?
Ok final time posting here, I have now spent the last 48 hours trying to get this to work and it turns out things don't work well since the "upgrade": "websocket" header seems to only work with GET calls, and GET calls don't support bodys. The final solution I've come to is copying what the "itty-durable" library does and pass in the data through the header. my fetch now looks like this
I'm posting this in the small chance someone else comes across the same issue. TBH this experience has soured me a little bit on durable objects and the cloudflare worker environment but whatever its too late for me to switch now.
6 replies
CDCloudflare Developers
•Created by TheKaiser on 8/31/2023 in #workers-help
How do i send data from worker to durable object fetch?
also in case anyone else is trying this I needed to include an application type header so the full line looks like this now
6 replies
CDCloudflare Developers
•Created by TheKaiser on 8/31/2023 in #workers-help
How do i send data from worker to durable object fetch?
Figured it out! I wrapped the fetch in a ctx.waitUntil() and for some reason that finally told me the error was because I was including a body in a GET http call. The line now just looks like
even though it doesn't really matter what the method is, the DO is really simple and only has one route
6 replies
CDCloudflare Developers
•Created by TheKaiser on 8/31/2023 in #workers-help
How do i send data from worker to durable object fetch?
I'm not getting any usefull error messages, just "500 Internal Server Error" when running wrangler dev locally and
when running wrangler dev remotely
6 replies
CDCloudflare Developers
•Created by TheKaiser on 8/31/2023 in #workers-help
How do i send data from worker to durable object fetch?
I'm pretty sure i need it, if i get rid of the {body: body} and make it just body my editor flags it because it needs to be a 'RequestInit<CfProperties<unknown>>'
6 replies