diff --git a/external/dist/webpack.js b/external/dist/webpack.js index 6cb7561a0..f2c4a6400 100644 --- a/external/dist/webpack.js +++ b/external/dist/webpack.js @@ -16,6 +16,11 @@ var pdfjs = require('./build/pdf.js'); var PdfjsWorker = require('worker-loader!./build/pdf.worker.js'); -pdfjs.PDFJS.workerPort = new PdfjsWorker(); + +if (typeof window !== 'undefined' && 'Worker' in window) { + pdfjs.PDFJS.workerPort = new PdfjsWorker(); +} else { + pdfjs.PDFJS.disableWorker = true; +} module.exports = pdfjs;