diff --git a/lib/queue.js b/lib/queue.js index 04420c4d0..9809d2a6a 100755 --- a/lib/queue.js +++ b/lib/queue.js @@ -663,8 +663,10 @@ Queue.prototype.setHandler = function(name, handler) { this.setWorkerName(); if (typeof handler === 'string') { + const supportedFileTypes = ['js', 'ts', 'flow']; const processorFile = - handler + (path.extname(handler) === '.js' ? '' : '.js'); + handler + + (supportedFileTypes.indexOf(path.extname(handler)) !== '-1' ? '' : '.js'); if (!fs.existsSync(processorFile)) { throw new Error('File ' + processorFile + ' does not exist');