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
Environment
NodeJS: 19
BullMQ: 3.2.1 Description
NodeJS module which built with ES6 (Put: "type" : "module" inside package.json) and run sandboxed version of Worker failed with the following error. The regular worker works as expected. Example const worker = new Worker("longJob", "longJob.js", { connection }) Error
Error: require() of ES Module /app/src/jobs/sandboxed/longJob.js from /app/node_modules/bullmq/dist/cjs/classes/child-processor.js not supported.\nInstead change the require of generateScanJob.js in /app/node_modules/bullmq/dist/cjs/classes/child-processor.js to a dynamic import() which is available in all CommonJS modules. Issue
child-processor.js should be used in esm package of bullmq
Line 25 inside file child-processor.js: processor = require(processorFile) is not valid in ES6
The text was updated successfully, but these errors were encountered:
Unfortunately, we cannot change the current implementation because even though it will fix this case it will break others, as this has been tried several times before and always resulted in broken deploys for other users. I do not see this as a bug in BullMQ, but unless proven the contrary a design flaw in the current NodeJS ecosystem.
Environment
NodeJS: 19
BullMQ: 3.2.1
Description
NodeJS module which built with ES6 (Put: "type" : "module" inside package.json) and run sandboxed version of Worker failed with the following error. The regular worker works as expected.
Example
const worker = new Worker("longJob", "longJob.js", { connection })
Error
processor = require(processorFile)
is not valid in ES6The text was updated successfully, but these errors were encountered: