Reputation:
I did the development in a Docker environment on Linux of an application that calls Chromium headless, controlled by the puppeteer.
The container runs perfectly on the machine, however when deploying to Cloud Run and the application calls the browser, the following exception returns:
(node: 14) UnhandledPromiseRejectionWarning: Open browser error
(node: 14) UnhandledPromiseRejectionWarning: Rejection of untreated promise. This error originated when launching inside an asynchronous function without a catch block or when rejecting a promise that was not handled with .catch (). (rejection id: 1)
(node: 14) [DEP0018] Discontinuation notice: Unhandled promise rejections have been discontinued. In the future, unclaimed promise rejections will end the Node.js process with a non-zero exit code.
I am using a version 80 of Chromium and a version 5.4.1 of Puppeteer. I've tried to downgrade Chromium and Puppeter. The container runs on my Linux machine normally, but the same problem happens in GCP
Upvotes: 0
Views: 368
Reputation: 693
From the error you are receiving it seems that you have an async...await
that is not returning a promise.
An async
function should always return a promise. As long as the implicit return value does not cause problems, everything should be perfect but it seems that you have something in your code that it makes it act funky when you are uploading it to GCP.
I would check the version you have installed of node with the one that you see in GCP and see if there are misshapes in here.
Otherwise, unless API supports promises then the errors should be entirely handled.
If you could also provide the code would be useful to see where is the actual issue but also I would suggest you to if you did not already wrap your body in a try..catch
statement in order to rule out unhandled rejections which may occur or result in exceptions in future Node versions.
Upvotes: 0