Vercel add Job : TypeError: client.addJob is not a function
See original GitHub issueThanks 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:
- Created 2 years ago
- Reactions:3
- Comments:32 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@ctrlaltdylan any chances to report this issue to the Vercel team?
I had the same issue with esbuild. I solved it by declaring bullmq as external
esbuild --external:bullmq