Puppeteer browser launch fails with crashForExceptionInNonABIComplianceCodeRange error

I’m getting a weird error when trying to start puppeteer. The error message shows crashForExceptionInNonABIComplianceCodeRange and says it failed to launch the browser process.

I’m working on a simple PDF generation script that should convert HTML content to PDF format. Here’s my code:

(async function generatePDF() {
  try {
    const chromeInstance = await puppeteer.launch();
    const newTab = await chromeInstance.newPage();
    
    await newTab.setContent(htmlContent);
    await newTab.emulateMediaType("screen");
    await newTab.pdf({
      path: "output/documents/generated.pdf",
      format: "A4",
      printBackground: true
    });
    
    console.log('PDF created successfully');
    await chromeInstance.close();
    
  } catch (error) {
    console.log("Error occurred:", error);
  }
})();

The function should create a PDF file but it crashes right at the browser launch step. Has anyone seen this type of error before? What could be causing this issue?

had this exact issue last week! clear your npm cache first with npm cache clean --force, then reinstall puppeteer. also check if antivirus software is blocking the chrome executable - that’s what got me.

This usually means you’re low on memory or have corrupted Chrome files. I hit the same issue running puppeteer on a VPS with limited RAM. Add --disable-dev-shm-usage to your launch arguments and set an explicit executable path if you’ve got Chrome installed separately. I also had luck downgrading puppeteer - the newest versions sometimes don’t play nice with certain setups. Check your disk space too since Chrome needs temp storage to start up.

The crashForExceptionInNonABIComplianceCodeRange error typically indicates a version conflict between your Puppeteer and the Chrome browser. Ensure that the Chrome binary corresponds to your system architecture, especially if you’re using Docker. It’s advisable to start Puppeteer with the args options to disable the sandbox: { args: ['--no-sandbox', '--disable-setuid-sandbox'] }. Additionally, verify that all necessary dependencies for your Puppeteer version are up-to-date, as outdated libraries can frequently lead to these errors.