diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index b83f6d0..4ef40e1 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -1,3 +1,11 @@ +// Polyfill URL.parse for browsers that don't support it (Chrome <129, Firefox <135, Safari <18.2) +// Required by pdfjs-dist 5.x which uses this API in production builds +if (!('parse' in URL)) { + ;(URL as any).parse = (url: string, base?: string) => { + try { return new URL(url, base) } catch { return null } + } +} + import React from 'react' import { createRoot } from 'react-dom/client' import App from './App'