13 Replies
‘await’ the fetch no?
tried
doesnt work
Ahh but on cf workers you might need to use waitUntil on async functions
The worker might be terminating before it finishes
still no log
ohh
these are promises - await them
await the fetch and await the .json
i see
MDN Web Docs
Using the Fetch API - Web APIs | MDN
The Fetch API provides a JavaScript interface for accessing and manipulating parts of the protocol, such as requests and responses. It also provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network.
did still doesnt return anything
is your sendmsg function being awaited?
console.log(ctx) in this function works fine
it stops exactly at line 12 the res variable
SOLVED
Nice! Thought it might be that