Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

301
Vistas
How to run nodejs script that uses Puppeteer on Heroku

I have created a NodeJs script that uses Puppeteer to grab some data from a website and put it on a json file.

Here is my Dyno:

enter image description here

If I enter the heroku bash (heroku run bash -a my-app) and I run the script (npm run start) it works like a charm.

Instead, if I launch the script clicking on "Open app" button I get a page with the following error:

enter image description here

Having a look at logs I see this:

at=error code=H10 desc="App crashed" method=GET path="/" host=my-app.herokuapp.com request_id=653dbf69-d35c-4017-bxxf-cc0e1a5xxxce fwd="37.159.47.101" dyno= connect= service= status=503 bytes= protocol=https
2022-06-01T07:24:50.316302+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=my-app.herokuapp.com request_id=b49ac035-axxx-4372-a59e-118bcxxx6a3b fwd="37.159.47.101" dyno= connect= service= status=503 bytes= protocol=https

I have spent a lot of time searching for H10 error and I have tried every solution I encountered, none worked.

The point is: what is the right way to launch a NodeJs script since I'm using Puppeteer and then I have no web page to show? If I use the bash when I close it the script is killed as well.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I finally figure out how to run a script that is not a web app. I have changed "web" to "worker" in the Procfile:

worker: npm start

and then turn off the web dynos and turn on the fresh new worker:

enter image description here

(You can reach the same with Heroku CLI: heroku scale web=0 worker=1)

Source of solution.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Do you installed the puppeter webpack that recomends heroku? other solution that worked for me is to use "chrome-aws-lambda" library that integrates puppeteer and work in hostings like vercel or heroku

example of the library

import chromium from "chrome-aws-lambda";
const browser = chromium.puppeteer."any puppeteer function"

i hope this help you.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda