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

Question: why is browser.close() crasching when using browserless.io #79

Open
kimdah3 opened this issue Apr 14, 2023 · 2 comments
Open

Comments

@kimdah3
Copy link

kimdah3 commented Apr 14, 2023

Using https://github.com/guifromrio/puppeteer_on_deploy/blob/main/main.tsx crasches the app when closing.

error: Uncaught ErrorEvent {
  bubbles: false,
  cancelable: false,
  composed: false,
  currentTarget: null,
  defaultPrevented: false,
  eventPhase: 0,
  srcElement: null,
  target: WebSocket {
  url: "wss://chrome.browserless.io/?token=BROWSERLESS_TOKEN",
  readyState: 3,
  extensions: "",
  protocol: "",
  binaryType: "blob",
  bufferedAmount: 0
},
  returnValue: true,
  timeStamp: 1681473331975,
  type: "error",
  message: "WebSocket protocol error: Connection reset without closing handshake",
  filename: "",
  lineno: 0,
  colno: 0,
  error: undefined
}

Any idea on why, maybe it's a browserless.io thing?

@waptik
Copy link

waptik commented May 18, 2023

@kimdah3
Copy link
Author

kimdah3 commented May 27, 2023

consider trying https://github.com/waptik/puppeteer_on_deploy. Demo at https://fresh-screenshot.deno.dev

Got the same error along with
IO error: An established connection was aborted by the software in your host machine
I tried running on ubuntu 22 and it worked but not on my linux instance running at fly.io.

So as a work around I configure the timeout inside the socket url and I used that as a way of closing my browser instance by manually waiting for it to timeout. Not ideal but it doesn't crash the whole app.

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

2 participants