Skip to content

Commit b2ed945

Browse files
committed
fix(asyncReader): use legacy worker build for browser compatibility
The standard pdfjs-dist worker build uses Uint8Array.prototype.toHex natively, which requires Chrome 128+ and Firefox 132+. The legacy build includes a polyfill for this method, making it compatible with the browser targets declared in the project (Chrome 116+, Firefox ESR). Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 66a1689 commit b2ed945

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils/asyncReader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function loadPdfjs() {
2424

2525
function loadWorkerUrl() {
2626
if (!workerUrlPromise) {
27-
workerUrlPromise = import('pdfjs-dist/build/pdf.worker.min.mjs?url').then(
27+
workerUrlPromise = import('pdfjs-dist/legacy/build/pdf.worker.min.mjs?url').then(
2828
(mod) => mod.default as string
2929
)
3030
}

0 commit comments

Comments
 (0)