shebinleo/pdf2html

broken in next.js apis

Johnrobmiller opened this issue · 1 comments

This is a fresh project with nothing in it other than Next.js and this library. I tried out the example code in the README and got an extremely cryptic error.

Code:

import { NextApiRequest, NextApiResponse } from "next";
import pdf2html from "pdf2html";

export default async function pdfToHtml (req: NextApiRequest, res: NextApiResponse) {
    
  const html = await pdf2html.html("/pdfs/smallPdfExample.pdf")
  console.log("html: ", html)

  res.status(200).json({ name: 'John Doe' })
}

Error:
image

Closed, another issue encompasses this