-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Separate process worker not using TypeScript config #910
Comments
I cannot think about a workaround for this right now other than building the .ts file and use the .js file as a processor. A bit more inconvenient but with a proper build setup it should be achievable. |
Hi folks! Do you have any news? |
@nemmo you should build your processor and use the built .js file, that is the only solution that will work for some time. |
@manast If there was a way to specify how the process is spawned (command arguments?) then this problem would be easier to solve, at least with tsconfig-paths. |
We could use node's |
I believe we need to call Lines 36 to 37 in 10a9eae
I can't call process.on('message', function(msg) {
switch (msg.cmd) {
case 'init':
// this line
require('@babel/register').default({ extensions: [".js",".jsx",".ts",".tsx"] });
processor = require(msg.value);
if (processor.default) {
// support es2015 module.
processor = processor.default;
}
// ...
}
} This is originally passed in The fork is not inheriting the original arguments. For now, I'll have to use a patch it this way to make it still work for me in development. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
I'm trying to import my modules in a separate process (using
queue.process("path/to/processor.ts")
) using TypeScript.I get this error as soon as I try importing a module that is aliased using
tsconfig-paths
in the process file:I need
tsconfig-paths
as it is what my entire application is using, is there a way to configure how the process is spawned, preferrably so I can set it to use mytsconfig.json
?Test code to reproduce
processor.ts
import { something } from "aliased/modules"
Bull version
3.3.10
The text was updated successfully, but these errors were encountered: