Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope'

importScript() must be placed outside of a function. For your case you should use fetch(url). You should also add async to each function, and use it this way:

let message = fetchMyTournament(message).then(function(result){return result;});

For my case i was importing PouchDB like this: importScripts("//cdn.jsdelivr.net/pouchdb/5.3.1/pouchdb.min.js");

The url should start with proper http/https. So changing to this solved the problem: importScripts("https://cdn.jsdelivr.net/pouchdb/5.3.1/pouchdb.min.js");