Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pdfjs-dist/webpack causing errors with certain configs #11964

Merged
merged 1 commit into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion examples/webpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ the worker code, and the `workerSrc` path shall be set to the latter file.

## Worker loading

If you are getting the `Setting up fake worker` warning, make sure you are importing `pdfjs-dist/webpack` which is the zero-configuration method for Webpack users:
If you are getting the `Setting up fake worker` warning, make sure you are
importing `pdfjs-dist/webpack` which is the zero-configuration method for
Webpack users. You will need to install
[worker-loader](https://github.com/webpack-contrib/worker-loader) as a
dependency in your project in order to use `pdfjs-dist/webpack` (configuring
`worker-loader` is not necessary; just installing it is sufficient).

import pdfjsLib from 'pdfjs-dist/webpack';

Expand Down
8 changes: 0 additions & 8 deletions external/dist/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@

"use strict";

try {
require.resolve("worker-loader");
} catch (ex) {
throw new Error(
"Cannot find the `worker-loader` package, please make sure that it's correctly installed."
);
}

var pdfjs = require("./build/pdf.js");
var PdfjsWorker = require("worker-loader!./build/pdf.worker.js");

Expand Down