forked from jzillmann/pdf-to-markdown
-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Parsing PDF as MD fails in production in Nextjs 14
Parsing a pdf file as MD works fine in development, but fails in production, showing this error:
This is my typescript code:
async function getPDFContext(file: File) {
if (file) {
const pdf2md = require("@opendocsg/pdf2md")
const pdfBuffer = await file.arrayBuffer()
const pdfContent = await pdf2md(pdfBuffer)
return pdfContent
} else {
return null
}
}To Reproduce
In a Next.js app:
- Create a file input
- Open a pdf and parse it (should work)
- Build with
npm run build - Repeat step 2 (it fails)
Desktop:
- OS: Windows 11 64bit
- Browser: Chrome
- Version: 120.0.6099.224 (Official Build) (64-bit)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
