typescript-webworker
typescript-webworker copied to clipboard
Uncaught ReferenceError: exports is not defined
Sample work with sample worker, but when I add any import in my worker code, it starts failed with
Uncaught ReferenceError: exports is not defined
I also see
Object.defineProperty(exports, "__esModule", { value: true });
in generated code
I am facing the same problem because I am using import inside my worker.ts. I am importing a ts module that have the export keyword. I believe the file loader need to define that keyword somehow!
I'm also having this problem -- is there a solution?
I ended up having to write the classes that I import inside the workers file on top of the file. Not elegant, but it solved it at least.
@mohyeid thanks, I might end up doing that. @mogadanez were you able to find a different fix for this?