-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Puppeteer issues #20179
Comments
I'm trying to run a similar script with AWS Lambda and it also shows the |
I think this might be the same as #19507 |
I noticed the same issues, the warning is not preventing puppeteer to work, but the 30s delay in finishing the process is annoying. Here's a test case which I think exposes the cause of the delay: import puppeteer from "npm:[email protected]";
Deno.test("A", async (t) => {
const browser = await puppeteer.launch({
headless: "new",
handleSIGHUP: Deno.build.os !== "windows"
});
try {
await t.step("B", async () => {});
} finally {
await browser.close();
}
}); which outputs:
|
Thanks to #20868 (comment) , Now what would be the proper way to get this fixed upstream? Is there a mecanism for Deno specific overrides? Or the only solution is a fork? @dsherret |
Related #19507 |
Also seems related to puppeteer/puppeteer#11839 The snippet given in the above issue (which patches |
The below script reproduces the situation where import WebSocket from "npm:[email protected]";
const server = `
Deno.serve({ port: 3000 }, (req) => {
if (req.headers.get("upgrade") != "websocket") {
return new Response(null, { status: 501 });
}
const { socket, response } = Deno.upgradeWebSocket(req);
socket.addEventListener("message", (event) => {
socket.send("pong");
});
return response;
});
`;
const cmd = new Deno.Command("deno", { args: ["eval", server] });
const p = cmd.spawn();
setTimeout(() => {
const ws = new WebSocket("ws://localhost:3000");
ws.addEventListener("message", async (ev) => {
console.log("received", ev.data);
console.log("killing the server");
p.kill();
setTimeout(() => {
console.log("closing client websocket");
ws.close();
}, 1000);
});
ws.addEventListener("open", () => {
console.log("sending ping")
ws.send("ping");
});
}, 2000);
|
Looks like we don't propagate the closed state of |
…ion is closed (#25387) This change fixes the handling of upgraded socket from `node:http` module. In `op_node_http_fetch_response_upgrade`, we create DuplexStream paired with `hyper::upgrade::Upgraded`. When the connection is closed from the server, the read result from `Upgraded` becomes 0. However because we don't close the paired DuplexStream at that point, the Socket object in JS side keeps alive even after the server closed. That caused the issue #20179 This change fixes it by closing the paired DuplexStream when the `Upgraded` stream returns 0 read result. closes #20179
The post to announce the release of Deno 1.35 says that
npm:puppeteer
is now supported.I've been doing some tests and found a couple of issues with this package. This is the code I'm using:
After running this code, I see the following:
and the script keeps running for 30 seconds or so and cannot be closed, even with
Ctrl + C
. I'm not sure if the missing support forClientRequest.options.createConnection
makes the script to keep alive for 30 seconds after finishing.I've tried the same script in Node (with some modifications) and it everything run smoothly:
The text was updated successfully, but these errors were encountered: