diff --git a/gulpfile.js b/gulpfile.js index 4d574269fa86f7..a25dd399cdb197 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2165,8 +2165,6 @@ function packageJson() { license: DIST_LICENSE, optionalDependencies: { canvas: "^2.11.2", - }, - dependencies: { "path2d-polyfill": "^2.0.1", }, browser: { diff --git a/src/core/worker.js b/src/core/worker.js index b5b2f5059b5047..d4b02815660a1a 100644 --- a/src/core/worker.js +++ b/src/core/worker.js @@ -129,20 +129,6 @@ class WorkerMessageHandler { "; thus breaking e.g. `for...in` iteration of `Array`s." ); } - - // Ensure that (primarily) Node.js users won't accidentally attempt to use - // a non-translated/non-polyfilled build of the library, since that would - // quickly fail anyway because of missing functionality. - if (isNodeJS && typeof Path2D === "undefined") { - const partialMsg = - "The browser/environment lacks native support for critical " + - "functionality used by the PDF.js library (e.g. `Path2D`); "; - - if (isNodeJS) { - throw new Error(partialMsg + "please use a `legacy`-build instead."); - } - throw new Error(partialMsg + "please update to a supported browser."); - } } const workerHandlerName = docId + "_worker"; let handler = new MessageHandler(workerHandlerName, docId, port);