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

UnhandledPromiseRejectionWarning: TypeError: proc.send is not a function #1140

Closed
faizanalhassan opened this issue Mar 16, 2022 · 3 comments
Closed

Comments

@faizanalhassan
Copy link

Hi there, I just recently started using bullmq. During development, if there is any syntax error left in the script, instead of showing me the exact line from where the error was generated, program always shows me:

UnhandledPromiseRejectionWarning: TypeError: proc.send is not a function
    at C:\repos\tracking-engine\api\node_modules\bullmq\src\utils.ts:146:10
    at new Promise (<anonymous>)
    at Object.exports.asyncSend (C:\repos\tracking-engine\api\node_modules\bullmq\src\utils.ts:145:10)
    at Object.exports.childSend (C:\repos\tracking-engine\api\node_modules\bullmq\src\utils.ts:159:21)
    at process.<anonymous> (C:\repos\tracking-engine\api\node_modules\bullmq\src\classes\master.ts:32:9)
    at process.emit (events.js:327:22)
    at process.EventEmitter.emit (domain.js:467:12)
    at process._fatalException (internal/process/execution.js:163:25)

I have seen another similar issue #1120, but it was closed with the report that the issue is resolved in version 1.76.2, however, my version is 1.76.3 but still facing the error.
For example there was a typo (I wrote Joi.Array() instead of Joi.array()) that crashed the program, the program was not showing the error cause. Then I commented a thell imports for bullmq and then running the program showed me the exact line initiating the error.

@roggervalf
Copy link
Collaborator

hi @faizanalhassan could you please provide us a test case to reproduce this issue?

@faizanalhassan
Copy link
Author

This is an example with syntax error:

import { Queue, Worker, QueueScheduler } from "bullmq";

let x = 1
x()  // <--- this is the error

And error comes:

UnhandledPromiseRejectionWarning: TypeError: proc.send is not a function
    at C:\repos\tracking-engine\api\node_modules\bullmq\src\utils.ts:146:10
    at new Promise (<anonymous>)
    at Object.exports.asyncSend (C:\repos\tracking-engine\api\node_modules\bullmq\src\utils.ts:145:10)
    at Object.exports.childSend (C:\repos\tracking-engine\api\node_modules\bullmq\src\utils.ts:159:21)
    at process.<anonymous> (C:\repos\tracking-engine\api\node_modules\bullmq\src\classes\master.ts:32:9)
    at process.emit (events.js:315:20)
    at process._fatalException (internal/process/execution.js:163:25)

If we comment out the imports:

// import { Queue, Worker, QueueScheduler } from "bullmq";

let x = 1
x()  // <--- this is the error

then error is correct:

TypeError: x is not a function
    at Object.x (C:\repos\tracking-engine\api/error.js:4:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Module._compile (C:\repos\tracking-engine\api\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Object.newLoader [as .js] (C:\repos\tracking-engine\api\node_modules\pirates\lib\index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\repos\tracking-engine\api\worker.js:4:18)

@roggervalf
Copy link
Collaborator

@faizanalhassan last version should have a tentative fix, I couldn't reproduce it, but hopes it works for you. Feel free to reopen this issue if you still see it

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