Skip to content

Commit

Permalink
Fix vercel deployment: react-pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinJiang-k committed Oct 23, 2024
1 parent d467e1b commit a33e6c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const nextConfig = {
config.resolve.alias.encoding = false
return config
},
swcMinify: false,
}

export default nextConfig
5 changes: 4 additions & 1 deletion src/components/PdfRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import {
import Simplebar from 'simplebar-react'
import PdfFullscreen from './PdfFullscreen'

pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
'pdfjs-dist/build/pdf.worker.min.mjs',
import.meta.url,
).toString();

interface PdfRendererProps {
url: string
Expand Down

0 comments on commit a33e6c8

Please sign in to comment.