I'm using Puppeteer on Heroku and I receive the following error:
2022-10-03T16:51:52.616196+00:00 app[web.1]: Error: Failed to launch the browser process!
2022-10-03T16:51:52.616214+00:00 app[web.1]: [1003/165152.260124:FATAL:zygote_host_impl_linux.cc(117)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
2022-10-03T16:51:52.616214+00:00 app[web.1]: #0 0x55894fa52339 base::debug::CollectStackTrace()
2022-10-03T16:51:52.616215+00:00 app[web.1]: #1 0x55894f9c8f23 base::debug::StackTrace::StackTrace()
2022-10-03T16:51:52.616215+00:00 app[web.1]: #2 0x55894f9c6070 logging::LogMessage::~LogMessage()
2022-10-03T16:51:52.616215+00:00 app[web.1]: #3 0x55894d9c6c2b content::ZygoteHostImpl::Init()
2022-10-03T16:51:52.616216+00:00 app[web.1]: #4 0x55894f543c0f content::ContentMainRunnerImpl::Initialize()
2022-10-03T16:51:52.616216+00:00 app[web.1]: #5 0x55894f541bfd content::RunContentProcess()
2022-10-03T16:51:52.616216+00:00 app[web.1]: #6 0x55894f541d4e content::ContentMain()
2022-10-03T16:51:52.616217+00:00 app[web.1]: #7 0x55894f59920a headless::(anonymous namespace)::RunContentMain()
2022-10-03T16:51:52.616218+00:00 app[web.1]: #8 0x55894f598f15 headless::HeadlessShellMain()
2022-10-03T16:51:52.616219+00:00 app[web.1]: #9 0x55894be7a1e3 ChromeMain
2022-10-03T16:51:52.616219+00:00 app[web.1]: #10 0x7f8e87025d90 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
2022-10-03T16:51:52.616219+00:00 app[web.1]: #11 0x7f8e87025e40 __libc_start_main
2022-10-03T16:51:52.616220+00:00 app[web.1]: #12 0x55894be7a02a _start
2022-10-03T16:51:52.616221+00:00 app[web.1]:
2022-10-03T16:51:52.616222+00:00 app[web.1]:
2022-10-03T16:51:52.616222+00:00 app[web.1]:
2022-10-03T16:51:52.616222+00:00 app[web.1]: TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
2022-10-03T16:51:52.616223+00:00 app[web.1]:
2022-10-03T16:51:52.616223+00:00 app[web.1]: at onClose (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:286:20)
2022-10-03T16:51:52.616224+00:00 app[web.1]: at Interface.<anonymous> (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:274:24)
2022-10-03T16:51:52.616224+00:00 app[web.1]: at Interface.emit (node:events:525:35)
2022-10-03T16:51:52.616225+00:00 app[web.1]: at Interface.close (node:readline:590:8)
2022-10-03T16:51:52.616225+00:00 app[web.1]: at Socket.onend (node:readline:280:10)
2022-10-03T16:51:52.616225+00:00 app[web.1]: at Socket.emit (node:events:525:35)
2022-10-03T16:51:52.616226+00:00 app[web.1]: at endReadableNT (node:internal/streams/readable:1358:12)
2022-10-03T16:51:52.616226+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:83:21)
My Code:
const browser = await puppeteer.launch({
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
puppeteer heroku buildpack installed ! I tried some solutions but I was not successful.