You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
I'm using child_process's fork method to instantiate a subprocess, like so:
The problem is that when building (transpiling) my project, a
MODULE_NOT_FOUND
is thrown becauseworker.ts
turned intoworker.js
. Initially, mi idea was to omit the file extension, but if I do so, when running the project withnode-dev
, it throws aMODULE_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
The text was updated successfully, but these errors were encountered: