For Workes & Pages, what is the name of the domain?
local
What is the issue or error you’re encountering
Uncaught TypeError TypeError: Incorrect type for Promise: the Promise did not resolve to ‘Response’.
What steps have you taken to resolve the issue?
This program working fine, supabase procedure Send working fine, but Worker return error
export default {
async fetch(request, env, ctx) {
...
reqBody = await readRequestBody(request);
const supabase = createClient(`${URL}`, `${KEY}`);
await supabase.rpc("send", { txt: JSON.parse(reqBody).txt })
.then((ret)=>{
return new Response(JSON.stringify({ count: ret.count, data: ret.data, error: ret.error, status: ret.status, statusText: ret.statusText }), {
headers: {
"content-type": "application/json",
},
});
})
If I understand I return control to Cloudflare worker before branch inside Then working. But how to correctly rebuild this worker?