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:
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:
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.


