question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Webpack] Chunk for worker file is not created

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yurydelendikcommented, Apr 13, 2016

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 .

0reactions
andrewgleavecommented, Apr 14, 2016

Yeah, I got it working. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create an entirely self-contained chunk using Webpack 3
Using Webpack 3 to build my project, my initial approach was to create a separate entry for the service worker and put the...
Read more >
Code Splitting - webpack
The dependOn option allows to share the modules between the chunks: ... As you can see there's another runtime.bundle.js file generated besides ...
Read more >
Under The Hood - webpack
The bundling is a function that takes some files and emits others. ... When you describe an entry point - under the hood,...
Read more >
worker-loader - webpack - JS.ORG
chunkFilename, The filename of non-entry chunks for web workers ... Inline mode with the fallback value will create file for browsers without support...
Read more >
CommonsChunkPlugin - webpack
The CommonsChunkPlugin is an opt-in feature that creates a separate file (known as a ... When using `options.async` to create common chunks from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found