Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page crash is not handled #1401

Closed
schelkun opened this issue Nov 16, 2017 · 10 comments
Closed

Page crash is not handled #1401

schelkun opened this issue Nov 16, 2017 · 10 comments

Comments

@schelkun
Copy link
Contributor

Look at this issue for crash example: #1373

You will recieve:

(node:4181) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Page crashed!
(node:4181) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

That means page crashes is not handled and no special events exist for page crash.

@ebidel
Copy link
Contributor

ebidel commented Nov 16, 2017

You can use page.on('error', ...) event to catch page crashes, but +1 to this.

It would be really nice if crashes could also be handled in existing promise chains and try/catch. I see this error a lot in try-puppeteer.appspot.com and handling it is wonky with needing to add a process.on('unhandledRejection') handler.

@gajus
Copy link

gajus commented Nov 17, 2017

You can use page.on('error', ...) event to catch page crashes, but +1. It would be really nice if crashes could also be handled in the existing promise chain and/or try/catch. I see this a lot in try-puppeteer.appspot.com.

Does Puppeteer project have a delegated resource at Google?

Releases are being made with open bugs. Bug reports get closed without inspecting them. ... Looks really bad.

@ebidel
Copy link
Contributor

ebidel commented Nov 17, 2017

@gajus what does that have to do with my suggestion?

Can you link me to examples of issues that are closed without looking at them?

Keep in mind that chrome itself releases with bugs (puppeteer uses the latest chromiums). Sometimes we're working around those issues. Other times there are bugs introduced with puppeteer. Hence why this project is still v0.13.0.

@gajus
Copy link

gajus commented Nov 17, 2017

Can you link me to examples of issues that are closed without looking at them?

#1140

This was closed clearly ignoring the issue.

#982

(Albeit, I am happy with the new new Function workaround.)

Well, thats one example.

This was reported before v0.13.0 release.

#132 (possibly related to the issue that you've reported #827).

Nevertheless, v0.13.0 was still released now causing others to downgrade.

This suggestion to convert Puppeteer to a collection of stateless utilities (which would be a lot easier to maintain and reduce code surface) was discarded without any notice.

#1139 (comment)

The PRs remain open for weeks ...

Overall, the mood is uninviting to collaborate.

@ebidel
Copy link
Contributor

ebidel commented Nov 17, 2017

I'm sorry you feel that way.

Reading through those issues, all of them seem to have discussions. Some asked for more or clarifying information or had a commit/PR to address and close the issue (#1139). Others have workarounds posted (which address the issue). So everything was looked at.

For #1140, I see @aslushnikov was asking for a reproducible script. You gave one (thanks), but it looks specific to some unknown page nor does it include a URL for us to test against. TBH, this makes the issue look specific to your page, creates unnecessary back and forth, and ultimately prolongs fixing said bug. Since I'm unable to repro, having something from you that does repro the issue would be really helpful.

When projects see dozens of issues every day, it's critical that bugs are easy to repro 🙏. I see that you do a lot of great work on Github, so I'm sure you'll agree with that ask :) It saves everyone (reporters + maintainers) a lot of time/headache and it's why the project has a template for issues.

Looking at the PRs...I see few that have been open for weeks. FWIW, several of the older ones are POC ideas from the team...not necessarily things we'll incorporate into the project. Others are waiting for an author to respond or Google's silly CLA bot to do it's thing 🤖. Even really good ideas get closed b/c there are better things in the works.

Hope that helps.

@aslushnikov
Copy link
Contributor

It would be really nice if crashes could also be handled in existing promise chains and try/catch. I see this error a lot in try-puppeteer.appspot.com and handling it is wonky with needing to add a process.on('unhandledRejection') handler.

@ebidel I'm not sure I follow. Why would you need a process.on('unhandledRejection')? The intention with page.on('error') was that it is always enough.

@aslushnikov
Copy link
Contributor

@ebidel ah ok, I think I understand what's going on here.

@zhaolixin0726
Copy link

So what's the answer? I encountered the same problem.

@aslushnikov
Copy link
Contributor

@zhaolixin0726 You can handle page crashes with page.on('error') event listener. This will mitigate the unhandled promise rejection.

To address @ebidel's concerns, filed #1454 that describes expected behavior for page crashes.

The issue per se seems to be about handling the error event, so closing this.

@Hadh
Copy link

Hadh commented Nov 24, 2020

3 years later, is this issue solved yet? I'm having the same problem !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants