fetch() not working

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