Next.js Discord

Discord Forum

installing texlive-pdftex?

Unanswered
American Shorthair posted this in #help-forum
Open in Discord
American ShorthairOP
I want to generate some PDF from latex on the server. Code works locally but needs to have the pdflatex command installed, which I think is part of the texlive-pdftex YUM package. Even though I see the package listed here: https://docs.aws.amazon.com/linux/al2023/release-notes/all-packages-AL2023.2.html , and have the following in my vercel.json file:

{
  "buildCommand": "npm run build",
  "framework": "nextjs",
  "installCommand": "amazon-linux-extras enable texlive-pdftex && yum -y install texlive-pdftex && npm install"
}


I get this error in the install step of my vercel build:

Running "install" command: `amazon-linux-extras enable texlive-pdftex && yum -y install texlive-pdftex && npm install`...
Topic texlive-pdftex is not found.
Error: Command "amazon-linux-extras enable texlive-pdftex && yum -y install texlive-pdftex && npm install" exited with 4


Is there an explainer link somebody has handy if I want to do something like this?

1 Reply

American ShorthairOP
Follow-up: this install command "installCommand": "yum -y install install texlive-* && npm install" in vercel.json completes successfully, but at runtime I still get the following error:

Uncaught Exception     {"errorType":"Error","errorMessage":"Error: Unable to run pdflatex command.","stack":["Error: Error: Unable to run pdflatex command.","    at ChildProcess.<anonymous> (/var/task/.next/server/app/pdf/resume/[id]/route.js:9:953)","    at ChildProcess.emit (node:events:517:28)","    at ChildProcess._handle.onexit (node:internal/child_process:290:12)","    at onErrorNT (node:internal/child_process:477:16)","    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)"]}


Are the installed packages not visible to serverless functions?