Rewrire worker problem

in the last month I have used this code to do direct, but Error 1101 Worker threw exception has been coming out for 2 days, I can’t understand what has changed. i have tested other code but some problem no understand

addEventListener("fetch", event => {
  let requestURI = new URL(event.request.url);

  if (requestURI.hostname == "") {

async function rewriteURL(request) {
  var URI = new URL(request.url);

  URI.protocol = "http";

      URI.hostname = "urldestinationexample";
      return fetch(URI, request);