fetch() not working

fetch doesnt seem to return anything
No description
13 Replies
Dullaz
Dullaz5mo ago
‘await’ the fetch no?
Adi
Adi5mo ago
tried doesnt work
Dullaz
Dullaz5mo ago
Ahh but on cf workers you might need to use waitUntil on async functions The worker might be terminating before it finishes
Adi
Adi5mo ago
still no log
No description
Adi
Adi5mo ago
ohh
Walshy
Walshy5mo ago
these are promises - await them await the fetch and await the .json
Adi
Adi5mo ago
i see
Walshy
Walshy5mo ago
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.
Adi
Adi5mo ago
did still doesnt return anything
No description
Walshy
Walshy5mo ago
is your sendmsg function being awaited?
Adi
Adi5mo ago
console.log(ctx) in this function works fine it stops exactly at line 12 the res variable
Adi
Adi5mo ago
SOLVED
No description
Dullaz
Dullaz5mo ago
Nice! Thought it might be that
Want results from more Discord servers?
Add your server