I am trying to use the npm package critical (https://www.npmjs.com/package/critical).
It uses headless chromium through puppeteer. It used to work in node 14.x, but with node 22.x the following error raises:
Error: Failed to launch the browser process! /vercel/path0/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.mdThe following cli script is the one raising the error:
#!/bin/bashecho "Starting critical-css"./node_modules/critical/cli.js public/index.html --base public > ./assets/css/critical.cssecho "Done running critical-css"Project URL: https://github.com/zetxek/adrianmoreno.info
Is there any way to install the missing dependency? Has someone been able to run chromium in node 22.x in the build step?