diff --git a/packages/pdf-viewer/package.json b/packages/pdf-viewer/package.json index ab9d642bf..fc7f1d0ba 100644 --- a/packages/pdf-viewer/package.json +++ b/packages/pdf-viewer/package.json @@ -41,7 +41,7 @@ "@fortawesome/react-fontawesome": "0.2.0", "@joplin/lib": "~2.9", "async-mutex": "0.4.0", - "pdfjs-dist": "3.0.279", + "pdfjs-dist": "2.16.105", "react": "18.2.0", "react-dom": "18.2.0", "styled-components": "5.3.5" diff --git a/renovate.json5 b/renovate.json5 index 88fced520..851e3cce2 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -55,6 +55,18 @@ "typedoc", "webpack", + // pdfjs-dist requires the canvas package, which cannot be built in Windows. + // + // An unhandled error occurred inside electron-rebuild + // node-gyp failed to rebuild 'D:\a\joplin\joplin\packages\pdf-viewer\node_modules\canvas'. + // + // https://github.com/mozilla/pdf.js/issues/15112 + // + // Maybe need to install Canvas separately and follow the instruction here to setup the build properly on Windows: + // https://github.com/Automattic/node-canvas#compiling + + "pdfjs-dist", + // Too complex to upgrade past TinyMCE 5 // https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ "tinymce", diff --git a/yarn.lock b/yarn.lock index c1a50f9c7..fdd40da50 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4251,7 +4251,7 @@ __metadata: css-loader: 6.7.2 jest: 29.3.1 jest-environment-jsdom: 29.3.1 - pdfjs-dist: 3.0.279 + pdfjs-dist: 2.16.105 react: 18.2.0 react-dom: 18.2.0 style-loader: 3.3.1 @@ -10260,18 +10260,6 @@ __metadata: languageName: node linkType: hard -"canvas@npm:^2.10.1": - version: 2.10.2 - resolution: "canvas@npm:2.10.2" - dependencies: - "@mapbox/node-pre-gyp": ^1.0.0 - nan: ^2.17.0 - node-gyp: latest - simple-get: ^3.0.3 - checksum: b2e3eb4c3635fa2f67857619621c3d314f935a9e51904536dadf4908ab580dff4f5bcbaafe6eb0255247fa027ca494d5cd97c33376a49a0f994997263fa9944b - languageName: node - linkType: hard - "capital-case@npm:^1.0.4": version: 1.0.4 resolution: "capital-case@npm:1.0.4" @@ -12920,15 +12908,6 @@ __metadata: languageName: node linkType: hard -"decompress-response@npm:^4.2.0": - version: 4.2.1 - resolution: "decompress-response@npm:4.2.1" - dependencies: - mimic-response: ^2.0.0 - checksum: 4e783ca4dfe9417354d61349750fe05236f565a4415a6ca20983a311be2371debaedd9104c0b0e7b36e5f167aeaae04f84f1a0b3f8be4162f1d7d15598b8fdba - languageName: node - linkType: hard - "decompress-response@npm:^6.0.0": version: 6.0.0 resolution: "decompress-response@npm:6.0.0" @@ -13678,7 +13657,7 @@ __metadata: languageName: node linkType: hard -"dommatrix@npm:^1.0.1": +"dommatrix@npm:^1.0.1, dommatrix@npm:^1.0.3": version: 1.0.3 resolution: "dommatrix@npm:1.0.3" checksum: 8ac727c1a14cf8de30a5b49a3bd6b2622a661b391fe1ac54e855eaa14a857ed86d63492150b5f70f912acc24fa3acc31d750259c47e9b5801de237624b0a319f @@ -22633,13 +22612,6 @@ __metadata: languageName: node linkType: hard -"mimic-response@npm:^2.0.0": - version: 2.1.0 - resolution: "mimic-response@npm:2.1.0" - checksum: 014fad6ab936657e5f2f48bd87af62a8e928ebe84472aaf9e14fec4fcb31257a5edff77324d8ac13ddc6685ba5135cf16e381efac324e5f174fb4ddbf902bf07 - languageName: node - linkType: hard - "mimic-response@npm:^3.1.0": version: 3.1.0 resolution: "mimic-response@npm:3.1.0" @@ -23136,7 +23108,7 @@ __metadata: languageName: node linkType: hard -"nan@npm:2.17.0, nan@npm:^2.17.0": +"nan@npm:2.17.0": version: 2.17.0 resolution: "nan@npm:2.17.0" dependencies: @@ -25099,13 +25071,18 @@ __metadata: languageName: node linkType: hard -"pdfjs-dist@npm:3.0.279": - version: 3.0.279 - resolution: "pdfjs-dist@npm:3.0.279" +"pdfjs-dist@npm:2.16.105": + version: 2.16.105 + resolution: "pdfjs-dist@npm:2.16.105" dependencies: - canvas: ^2.10.1 + dommatrix: ^1.0.3 web-streams-polyfill: ^3.2.1 - checksum: 2e59d9bd4a8d7e01c79712435a7ce6a485f63b99620152384e3e110e068a0506dbf70ce39e5e9e61ea7228ad77fffcc716d5fc3a9221634e2e7f24acde267ebf + peerDependencies: + worker-loader: ^3.0.8 + peerDependenciesMeta: + worker-loader: + optional: true + checksum: 16ad2fa0ff8404fefd1a3e83f92ef1a594fcc4d3ff65512f801365c8f06d300d4a38023a867994f0b964a8e146773e6dcc9988c7c1a791917eb6371d5bd72863 languageName: node linkType: hard @@ -28651,17 +28628,6 @@ __metadata: languageName: node linkType: hard -"simple-get@npm:^3.0.3": - version: 3.1.1 - resolution: "simple-get@npm:3.1.1" - dependencies: - decompress-response: ^4.2.0 - once: ^1.3.1 - simple-concat: ^1.0.0 - checksum: 80195e70bf171486e75c31e28e5485468195cc42f85940f8b45c4a68472160144d223eb4d07bc82ef80cb974b7c401db021a540deb2d34ac4b3b8883da2d6401 - languageName: node - linkType: hard - "simple-get@npm:^4.0.0": version: 4.0.0 resolution: "simple-get@npm:4.0.0"