Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker Path Module not found #463

Open
anwarjaved opened this issue Feb 11, 2023 · 1 comment
Open

Worker Path Module not found #463

anwarjaved opened this issue Feb 11, 2023 · 1 comment

Comments

@anwarjaved
Copy link

I am trying to load Worker from same directory in nodejs typescript
it always throws Error: Cannot find module
I tried to load using relative path and also by absolute path but it always failed

@appocalypseltd
Copy link

Was literally about to post the same message...I have this:

import { Pool, spawn, Worker } from 'threads';
import * as w from './Worker';

export class EngineLearn {
  trainModels = async () => {
    const pool = Pool(() => spawn(new Worker('./Worker')));
    // ...do stuff with pool
  };
}

Error: Cannot find module 'engine-learn/Worker`

I am using @nrwl/esbuild:esbuild with Nx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants