-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I am working on an Angular 6 app, and I am trying to use a web worker Worker (via ngx-web-worker) to perform some complex and CPU-expensive operations. I have the following service:
import { MY_SCRIPT } from './my-script.script';
import { WebWorkerService } from 'ngx-web-worker';
@Injectable({
providedIn: 'root',
})
export class MyService {
constructor(private webworkerService: WebWorkerService) {
this.webworkerService.run(MY_SCRIPT).then((data) => {
console.log(data);
}, (error) => {
console.error(error);
});
}
}
where my-script.script.ts contains the following:
import { HelperClass } from './helper.class';
export const MY_SCRIPT = () => {
const helperClass: HelperClass = new HelperClass();
helperClass.doExpensiveComputation();
};
and helper.class.ts contains the following:
export class HelperClass {
doExpensiveComputation() {
// do some complex and expensive computation
}
}
The class HelperClass is not imported in any Angular module. The app builds fine, but at runtime I get an error with the following message:
Uncaught ReferenceError: _helper_class__WEBPACK_IMPORTED_MODULE_0__ is not defined
How can I give webpack the information it needs?
jayhaluska
Metadata
Metadata
Assignees
Labels
No labels