Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

113
Vistas
Importing inside a module web worker

I have an index.html file that has a script tag with type="module".

Inside this script tag, I create a simple module worker like so

    // index.html
    let processFrameWorker = new Worker("/parent/worker.js", { type: "module" });
    processFrameWorker.addEventListener('message', (event) => {
        console.table("Event", event)
        console.log("back from worker")
    })
    processFrameWorker.postMessage('Some message');

and inside my worker I have

   // worker.js
   import sayHello from "/greeting.js"
   onmessage = function (e) {
       console.log('Worker: Message received from main script');
       postMessage(sayHello());
   }

I keep coming across this error enter image description here

which points to the first line (importation line) of the worker. I am completely out of things to try on how to fix this issue. I would appreciate any help.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda