How do I add "waitUntil" to my worker and get it to return a responce (in the HTML responce body) WITHOUT screwing it up

Ok, so I have this worker and I want to add a waitUntil code in there and get it to return a response (in the HTML request body) WITHOUT screwing up the worker! The response will be “Whoops! You’ve triggered the ‘waitUntil’ code that’s apart of this worker! You might be sending requests too fast so slow down and wait 30 seconds before trying again!” I’ve provided by code right now to avoid any confusion (yes the return URL is random since this is one of my MANY experimental workers).

addEventListener("fetch", (event) => {
      (err) => new Response(err.stack, { status: 200 })

 * Many more examples available at:
 * @param {Request} request
 * @returns {Promise<Response>}
async function handleRequest(request) {
  const { pathname } = new URL(request.url);

  if (pathname.startsWith("/api")) {
    return new Response(JSON.stringify({ pathname }), {
      headers: { "Content-Type": "application/json" },

  if (pathname.startsWith("/status")) {
    const httpStatusCode = Number(pathname.split("/")[2]);

    return Number.isInteger(httpStatusCode)
      ? fetch("{zone_type}&utm_creative=10783819&click_id=480548069738570451" + httpStatusCode)
      : new Response("Get rid of those annoying popup ads");

  return fetch("{zone_type}&utm_creative=10783819&click_id=480548069738570451");

So anyone know how I can add waitUntil and have the worker get a response (if waitUntil is triggered and terminates the request)? And (again) this would be done WITHOUT screwing up the worker (so it will still respond, but only if waitUntil isn’t triggered)

I believe the that fetch should be awaited

What do you mean?

The node fetch API is asynchronous