pdf.js: [Webpack] Chunk for worker file is not created
When using webpack, the chunk that should be populated for the worker.js file does not exist and the dynamic load of the worker fails when pdfjs is used.
Also, when webpack finishes I have a chunk that contains the following:
webpackJsonp([1],{
/***/ 92:
/***/ function(module, exports) {
/* (ignored) */
/***/ }
});
I have no idea, what that means.
The version 1.4.x has this problem, version 1.3.x works ok.
Note: we are using pdfjs-dist npm package.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (7 by maintainers)
The worker is not bundled automatically after #7189. Please add workerSrc setting and bundling procedure for pdf.worker.entry.js. See https://github.com/mozilla/pdf.js/blob/master/examples/webpack/main.js#L11 and https://github.com/mozilla/pdf.js/blob/master/examples/webpack/webpack.config.js#L8 .