fetch() not working

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