title: Failed to launch the browser process!\n/tmp/chromium: error while loading shared libraries: libnss3.so Vercel
body: <p>When I try to run Next js API on production Vercel I get this error</p>
  <blockquote>
  <p>Failed to launch the browser process!\n/tmp/chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: <a href="https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md%5Cn%22" rel="nofollow noreferrer">https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n&quot;</a></p>
  </blockquote>
  <p>Locally everything works, but on production, I am having this error.</p>
  <p>This is my code from API:</p>
  <pre><code>import chromium from &quot;chrome-aws-lambda&quot;;
  
  async function getBrowserInstance() {
    const executablePath = await chromium.executablePath;
  
    if (!executablePath) {
      // running locally
      const puppeteer = require(&quot;puppeteer&quot;);
      return puppeteer.launch({
        args: chromium.args,
        headless: true,
        defaultViewport: {
          width: 1280,
          height: 720,
        },
        ignoreHTTPSErrors: true,
        ignoreDefaultArgs: [&quot;--disable-extensions&quot;],
      });
    }
  
    return chromium.puppeteer.launch({
      args: [
        ...chromium.args,
        &quot;--hide-scrollbars&quot;,
        &quot;--disable-web-security&quot;,
        &quot;--no-sandbox&quot;,
        &quot;--disable-setuid-sandbox&quot;,
      ],
      defaultViewport: {
        width: 1280,
        height: 720,
      },
      executablePath: await chromium.executablePath,
      headless: chromium.headless,
      ignoreHTTPSErrors: true,
      ignoreDefaultArgs: [&quot;--disable-extensions&quot;],
    });
  }
  </code></pre>