diff --git a/config/webpack/webpack.common.ts b/config/webpack/webpack.common.ts index e044c324837fe..1992a27c40c38 100644 --- a/config/webpack/webpack.common.ts +++ b/config/webpack/webpack.common.ts @@ -179,7 +179,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment): // We are importing this worker as a string by using asset/source otherwise it will default to loading via an HTTPS request later. // This causes issues if we have gone offline before the pdfjs web worker is set up as we won't be able to load it from the server. { - test: new RegExp('node_modules/pdfjs-dist/build/pdf.worker.min.mjs'), + test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs'), type: 'asset/source', }, diff --git a/package-lock.json b/package-lock.json index 3bbf0f2e6e2b2..eb68bfe5d35f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,7 +76,7 @@ "react-content-loader": "^7.0.0", "react-dom": "18.3.1", "react-error-boundary": "^4.0.11", - "react-fast-pdf": "1.0.21", + "react-fast-pdf": "^1.0.22", "react-map-gl": "^7.1.3", "react-native": "0.76.3", "react-native-android-location-enabler": "^2.0.1", @@ -31907,9 +31907,9 @@ } }, "node_modules/react-fast-pdf": { - "version": "1.0.21", - "resolved": "https://registry.npmjs.org/react-fast-pdf/-/react-fast-pdf-1.0.21.tgz", - "integrity": "sha512-8Uuz/jPHjHqElH+aUj3ldS/Hg/NoZ5ZS/VupGzDkVJST0UiGzxkvDxxFIQuYuiaI4NGwGmqtQGGYsjJKpyWnig==", + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/react-fast-pdf/-/react-fast-pdf-1.0.22.tgz", + "integrity": "sha512-bU1YEHFfazKFSdmNAauD267GtjVHdcuE39jyHJQ8CRI8ZWWLwckZ8azPuE25i+hodCBmQuTNBdg6Gx4OhP8HOQ==", "license": "MIT", "dependencies": { "react-pdf": "^9.1.1", diff --git a/package.json b/package.json index 93fc066b8cd69..685e5d3464c57 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,7 @@ "react-content-loader": "^7.0.0", "react-dom": "18.3.1", "react-error-boundary": "^4.0.11", - "react-fast-pdf": "1.0.21", + "react-fast-pdf": "^1.0.22", "react-map-gl": "^7.1.3", "react-native": "0.76.3", "react-native-android-location-enabler": "^2.0.1", diff --git a/src/components/PDFThumbnail/index.tsx b/src/components/PDFThumbnail/index.tsx index 6b83afe603c1c..495c14ff76e15 100644 --- a/src/components/PDFThumbnail/index.tsx +++ b/src/components/PDFThumbnail/index.tsx @@ -1,6 +1,6 @@ import 'core-js/proposals/promise-with-resolvers'; // eslint-disable-next-line import/extensions -import pdfWorkerSource from 'pdfjs-dist/build/pdf.worker.min.mjs'; +import pdfWorkerSource from 'pdfjs-dist/legacy/build/pdf.worker.min.mjs'; import React, {useMemo, useState} from 'react'; import {View} from 'react-native'; import {Document, pdfjs, Thumbnail} from 'react-pdf'; diff --git a/src/types/modules/pdf.worker.d.ts b/src/types/modules/pdf.worker.d.ts index c636372b411d1..a6d70e529b7f1 100644 --- a/src/types/modules/pdf.worker.d.ts +++ b/src/types/modules/pdf.worker.d.ts @@ -1 +1 @@ -declare module 'pdfjs-dist/build/pdf.worker.min.mjs'; +declare module 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';