Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

385
Views
Puppeteer error - Failed to launch the browser process

Error while running the following code:

here is all the code that I'm using to try download an PDF file that was created previously:

import puppeteer, { PDFOptions } from 'puppeteer';

interface Request {
  pageContent: string;
  pdfOptions?: PDFOptions;
}
class GeneratePDFFileService {
  async execute({ pageContent, pdfOptions }: Request): Promise<Buffer> {
    const browser = await puppeteer.launch ({ 
      headless: true, 
      args:['--no-sandbox'] 
    });
    const page = await browser.newPage();
    await page.setContent(pageContent);
    const pdfFileOptions = pdfOptions || {
      printBackground: true,
      format: 'a4',
      margin: {
        top: '2cm',
        left: '2cm',
        bottom: '2cm',
        right: '2cm',
      },
      preferCSSPageSize: true,
    };
    const pdf = await page.pdf(pdfFileOptions);
    await browser.close();
    return pdf;
  }
}
export { GeneratePDFFileService };

Here is the error:

application  | Error: Failed to launch the browser process! spawn /usr/bin/chromium-browser ENOENT
application  | 
application  | 
application  | TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
application  | 
application  |     at onClose (/usr/app/node_modules/puppeteer/src/node/BrowserRunner.ts:261:9)
application  |     at ChildProcess.<anonymous> (/usr/app/node_modules/puppeteer/src/node/BrowserRunner.ts:250:9)
application  |     at ChildProcess.emit (events.js:400:28)
application  |     at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
application  |     at onErrorNT (internal/child_process.js:469:16)
application  |     at processTicksAndRejections (internal/process/task_queues.js:82:21)

Puppeteer version:
"puppeteer": "^13.1.3",

I've tried some tips in troubleshooting.md, but have no idea if I'm doing it right.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!