Open danybeltran opened 8 months ago
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:
npm run build
Desktop:
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:
To Reproduce In a Next.js app:
npm run build
Desktop: