-
Notifications
You must be signed in to change notification settings - Fork 353
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 adapter: "Evaluation failed: TypeError: Failed to fetch" #149
Comments
@2xAA if you can post the following:
|
We decided not to use Polly in our project in the end. Using Puppeteer by itself provides enough functionality for us. I doubt this issue would have been too helpful anyway as I'm unable to share the website we were testing or much of the test code. Using the same test code with other websites didn't produce this error. Setting the Setting These are my versions, just in case:
|
Closing for now since there isn't anything actionable. We'll keep an eye out for this in the future. |
FYI this happens because of CSP errors and can be resolved with: await page.setBypassCSP(true); |
@scotthovestadt do you know in what scenario this happens? Any chance you can PR a fail test for adapter-puppeteer/tests/integration/adapter-test.js |
An easy way to reproduce it is to just open the console on github.com (this page works fine) and enter: fetch('https://github.githubassets.com/favicon.ico') This shows in the console as:
It's triggered by the following header:
I'll look into setting up a fail test, but regardless is probably a good idea to just recommend that the user turn this on in the documentation or even in the error message for Thoughts? |
@scotthovestadt I agree with adding a warning the documentation. However, I'm a bit confused. If the CSP rules do not account for a hostname you're trying to reach then I'd except the CSP violation with or without Polly being present. Is that not the case? |
It's not trying to Ordinarily the favico would be loaded "normally" but it's proxied through |
This sounds like a bug where non-xhr requests are being picked up via Polly. The expectation would be Polly wouldn't be proxying these sorts of resource requests. We'll need to investigate why that's happening. |
@scotthovestadt yeah, exactly! Will be resolved by #197 Thanks for bringing all this context to the discussion, super helpful. |
Glad I could help! |
I'm attempting to use Polly in an existing project to test a webform, however upon adding Polly with the Puppeteer adapter I'm running into this error from Puppeteer.
Evaluation failed: TypeError: Failed to fetch
This error isn't present without Polly and the Puppeteer adapter.
I can provide more details upon request, but I'm unsure on what I need to share to diagnose this issue right now.
Thanks.
The text was updated successfully, but these errors were encountered: