question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vercel add Job : TypeError: client.addJob is not a function

See original GitHub issue

Thanks for developing this open source. I really enjoy it. I have encountered this problem when running on vercel serverless. The source code works perfectly fine on local.

{
  "errorType": "Runtime.UnhandledPromiseRejection",
  "errorMessage": "TypeError: client.addJob is not a function",
  "reason": {
    "errorType": "TypeError",
    "errorMessage": "client.addJob is not a function",
    "stack": [
      "TypeError: client.addJob is not a function",
      " at Function.addJob (/var/task/node_modules/bullmq/dist/classes/scripts.js:52:23)",
      " at Job.addJob (/var/task/node_modules/bullmq/dist/classes/job.js:352:34)",
      " at Function.create (/var/task/node_modules/bullmq/dist/classes/job.js:34:28)",
      " at processTicksAndRejections (internal/process/task_queues.js:93:5)",
      " at Queue.add (/var/task/node_modules/bullmq/dist/classes/queue.js:38:25)"
    ]
  },
  "promise": {},
  "stack": [
    "Runtime.UnhandledPromiseRejection: TypeError: client.addJob is not a function",
    " at process.<anonymous> (/var/runtime/index.js:35:15)",
    " at process.emit (events.js:327:22)",
    " at process.emit (/var/task/___vc_sourcemap_support.js:587:21)",
    " at processPromiseRejections (internal/process/promises.js:245:33)",
    " at processTicksAndRejections (internal/process/task_queues.js:94:32)"
  ]
}

Example Code:

const connection = new IORedis(process.env.REDIS_URI);
const queue = new Queue('SENDEMAIL', { connection });
const job = await queue.add('SEND',  { email });

I found a workaround for this while customizing the vercel.json file. Hope to be able to help anyone who is having this problem.

    "functions": {
        "api/serverless.ts": {
            "includeFiles": "node_modules/bullmq/dist/commands/**",
        }
    },

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:32 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
manastcommented, Feb 4, 2022

@ctrlaltdylan any chances to report this issue to the Vercel team?

1reaction
Kounda-Dartagnancommented, May 21, 2021

I had the same issue with esbuild. I solved it by declaring bullmq as external esbuild --external:bullmq

Read more comments on GitHub >

github_iconTop Results From Across the Web

OptimalBits/bull - Gitter
Some jobs in my queue seem to be marked as 'completed' but the process function is not called. They show up as completed...
Read more >
map is not a function Vercel Deploy - next.js - Stack Overflow
When I deploy this next.js app on Vercel, I get the following error: > Build error occurred 21:23:30 TypeError: albums.map is not a...
Read more >
“Module not found: Can't resolve '@material-ui/icons ... - Grepper
You need to install Icons Yarn add @material-ui/icons npm install ... '/vercel/path0/client/src/components/Posts/Post' · material ui module not found can't ...
Read more >
this page doesn’t appear to be using react. if this seems ...
But when I enable react devtools on my react app, it does not activate and I get ... id); }) } } export...
Read more >
Windows Analysis Report bby.exe - Joe Sandbox
presents to client programs. If a C-function, structure, datatype,.** or constant definition does not appear in this file, then it is.** not a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found