'Failed to fetch' error when calling fetch in `cypress run`
See original GitHub issueCurrent behavior:
Getting Failed to fetch
error when running cypress run
and visiting a website in https
.
I’m not getting this error when running in cypress open
and also not when running in http
websites.
Desired behavior:
Not to get this error.
Steps to reproduce:
I made one commit to demonstrate the problem in the following fork and branch: https://github.com/amitzur/cypress-test-tiny/tree/fetch_issue
I’m calling fetch
inside a custom command to a local webserver launched in a cypress plugin.
Versions
This happens on both Cypress version 2.1.0
and 3.0.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Cypress Code coverage within docker: failed to Fetch error
It looks like it might be coming from the cy.request() that fetches backend coverage, here. code-coverage/support.js
Read more >Error Messages | Cypress Documentation
This message means that Cypress was unable to find tests in the specified file. You'll likely get this message if you have an...
Read more >cypress-io/cypress - Gitter
cypress "cannot see" fetch request that it is why we need to remove it from window or add polyfill, to make all request...
Read more >Fetch API gotcha in cypress.io and how to fix it.
The problem: When you use the fetch API on the client side, you cannot stub routes in cypress.io because of the lack in...
Read more >TypeError: Failed to fetch and CORS in JavaScript | bobbyhadz
An incorrect or incomplete URL has been passed to the fetch() method. · The server you are making a request to does not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Honestly, I’m not sure about where the difference originates. I believe you should be able to set
chromeWebSecurity
tofalse
in yourcypress.json
if you want to ignore this error in your tests though.Have you managed to solve it ? I am facing the same problem too