your worker created multiple branches

I've got this error every single time in Wrangler, sometimes it results in crashes, sometimes not, but I cannot fathom why. This is the entirety of my function so far
export function onRequest(context) {
if(context.request.method !== 'POST') {
return new Response('Not allowed', { status: 405 }
}
try {
return new Response('OK', { status: 200 });
} catch(e) {
throw new Error('Error')
}
}
export function onRequest(context) {
if(context.request.method !== 'POST') {
return new Response('Not allowed', { status: 405 }
}
try {
return new Response('OK', { status: 200 });
} catch(e) {
throw new Error('Error')
}
}
Please help me to understand why I'm getting this error. I'm not cloning anything. What does cloning even mean? This is on Wrangler 3.22.3
1 Reply
endymion1818
endymion18185mo ago
I've resolved this one myself although I think the error handling is pretty shaky here, all I got was some issue about something evaluating to false.