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
[Bug]: #12390
Comments
This issue has an invalid Node.js version: |
Please include a test page into the example and the complete script demonstrating the issue. |
I just added more code for a better understanding of the issue and changed the Reality paragraph, and I didn't include the URL cause it requires a login. |
Please create a test page that shows the problem. Without it there is no way to debug the issue. |
the way this is written it looks like a race condition since all requests can already fire by the time getTheAudio is called. So without an executable example it is not possible to debug. |
Idk what else I should provide cause I'm not that smart :), and the reason I didn't provide more code is gonna distract you from the issue, so I tried to keep it minimal as much as possible, and for the URL It requires a login, cause it's a school site, I hope that cleared why I couldn't share any more details, and sorry for the inconvenience |
since I'm Stupid I asked chatgpt to generate a test: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Puppeteer Audio Response Test Page</title>
</head>
<body>
<h1>Puppeteer Audio Response Test Page</h1>
<button id="trigger-response">Trigger Audio Response</button>
<script>
document.getElementById('trigger-response').addEventListener('click', async () => {
// Simulate fetching an audio response
const response = await fetch('/fake-audio-response');
// Simulate processing the response
if (response.ok) {
// Simulate extracting the audio data
const audioBlob = await response.blob();
// Simulate playing the audio
const audioUrl = URL.createObjectURL(audioBlob);
const audioElement = new Audio(audioUrl);
audioElement.play();
} else {
console.error('Failed to fetch audio response');
}
});
</script>
</body>
</html> |
Minimal, reproducible example
Main file ( "Index.js" type ="module")
The Function: "getTheAudio.mjs"
Error string
no error
Bug behavior
Background
Bug Report: Inconsistent Detection of Responses in Puppeteer
Description:
The
getTheAudio
function is designed to catch responses with a specific content type (audio/mpeg
) and save them to a file. However, there are instances where the desired response (.blu
file) is not detected by Puppeteer'spage.on("response")
event handler, leading to inconsistent behavior.Observations:
.har
file from the Network tab revealed that the response was indeed present, even though it was not detected by Puppeteer or shown in the Chrome DevTools Network tab.Expectation
I expected that response to get detected everytime.
Reality
I receive a bunch of .blu files as a response but it's always the first file that doesn't get detected , sometimes it does, sometimes it doesn't
Puppeteer configuration file (if used)
No response
Puppeteer version
22.7.0
Node version
20.12.2
Package manager
npm
Package manager version
10.2.4
Operating system
Windows
The text was updated successfully, but these errors were encountered: