Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
How to import modules with web workers?

How do I import a library like jimp or moment in a Web worker?

I tried to follow the answers given here How to import a library like moment.js into a web worker, but they did not work:

With the entry point, the bundle file was never produced and I couldn't use the web worker.

With the web-worker, it says Attempted import error:

'./myWorker.worker.js' does not contain a default export (imported as 'Worker').

I also tried the solution given here:

Web Workers - How To Import Modules

I was able to access the WebWorker and get it to post a message (unlike in the above solutions), but as soon as I add import statements, it just gives an error like this:

enter image description here

How can I fix this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!