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

Ignore filename extension for child_process fork using when using Typescript #265

Open
franciscohanna92 opened this issue Aug 27, 2021 · 0 comments

Comments

@franciscohanna92
Copy link

I'm using child_process's fork method to instantiate a subprocess, like so:

fork(path.join(__dirname, './worker.ts'));

The problem is that when building (transpiling) my project, a MODULE_NOT_FOUND is thrown because worker.ts turned into worker.js. Initially, mi idea was to omit the file extension, but if I do so, when running the project with node-dev, it throws a MODULE_NOT_FOUND because it can't resolve the file if the extension is not present.

What's the workaround for this?

I'm on Windows 10 using node v12.22.1

@franciscohanna92 franciscohanna92 changed the title Ignore extension on filename for child_process fork Ignore filename extension for child_process fork using when using Typescript Aug 27, 2021
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

1 participant