NativeScript/worker-loader

demo-angular fails to build: Cannot find module 'nativescript-worker-loader!....'

Eonfuzz opened this issue · 10 comments

Full error:

file:///app/worker.service.js:5:23: JS ERROR Error: Could not find module 'nativescript-worker-loader!./workers/typescript.worker'. Computed path '/Users/Eonfuzz/Library/Developer/CoreSimulator/Devices/27BC1C0E-FFE7-4EFE-829A-10D9A18FE2AF/data/Containers/Bundle/Application/076FE98C-5BF4-4C9E-B897-3B1C280490FC/demoangular.app/app/tns_modules/nativescript-worker-loader!./workers/typescript.worker'.

To reproduce:
git clone https://github.com/NativeScript/worker-loader
cd worker-loader/demo-angular
npm i
tns run ios

Facing the same issue for Android

Any opdate on this?

I got around it by not using it "The Webpack way" and instead just creating it manually via:
const worker = new Worker("./worker-script");

same issue with Vue

I had this issue as well. The problem had to do with typescript not liking my route. I ended up having to make it something like: import * as TsWorker from "nativescript-worker-loader!../../../workers/worker";

Issue tends to be the path.

jrkf commented

any updates? I have similar problem and I don't know how to fix it...

me too

I'm also facing the same issue in both platforms