0

I have a WebWorker where I'm using imports. I'm able to import a class and use it.

I have a file that has 2 classes in it, where one class is using angular, firebase, and other imports for that class; the other class is just a construction class that builds an object. Whenever I import the plain constructor class I run into this:

./src/app/import.worker.ts (./node_modules/worker-plugin/dist/loader.js?
{"name":"0"}!./src/app/import.worker.ts)
Module build failed (from ./node_modules/worker-plugin/dist/loader.js)

I'm guessing that angular is somehow involved because the specific class I'm importing uses no dependencies.

Is there a way around this error so that I can import a plain class that is in a file full of other dependencies? Should I look into angular/webpack and how it's compiling files for the webworker?

theman0123
  • 153
  • 1
  • 17
  • Did you resolve this issue? – xzegga May 19 '20 at 18:15
  • @xzegga we did not end up using web-workers for this issue. We solved the problem above but I'm not sure how since the code is no longer readily available. Sorry! – theman0123 May 20 '20 at 20:50
  • I could resolve this issue, I was importing `of` operator of `rxj` in the function that I was executing in the worker context. that was causing the problem. I remove the operator from the function and import directly in the worker to transform to observable the worker response. – xzegga May 21 '20 at 01:17

0 Answers0