Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchFor current Cypress, remove experimentalFetchPolyfill from your configuration. Cypress removed that option; use cy.intercept() to spy on or control fetch-backed requests in tests. Add a real fetch polyfill only if your application must support a browser that does not provide window.fetch, and load it into the application before code that calls fetch.
First decide whether you need a polyfill or request interception
These solve different problems. A fetch polyfill gives application code a fetch API in a browser that lacks one. Cypress’s cy.intercept() observes, stubs, or modifies HTTP traffic for a test. A polyfill does not itself make a test response deterministic, and interception does not add a missing browser API.
As an Amazon Associate I earn from qualifying purchases.
| Need | Use | Where it runs |
|---|---|---|
The application must run in a supported browser without native fetch. |
A project-appropriate fetch polyfill. | In the application runtime, before code that uses fetch. |
| A test needs to observe or control an API request. | cy.intercept(). |
In Cypress test setup. |
Cypress’s migration guidance says to remove the old setting and use cy.intercept() for fetch requests. Its recipes index calls the relevant example “Stubbing window.fetch.”
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Stub a fetch-backed request with cy.intercept()
Register the route before visiting the app or taking the action that triggers the request. For example:
#1 Best Overall
// In a spec, before the action that triggers the request
cy.intercept('GET', '/api/users', {
statusCode: 200,
body: [{ id: 1, name: 'Ada' }],
}).as('getUsers')
cy.visit('/')
cy.get('[data-cy=load-users]').click()
cy.wait('@getUsers')
.its('response.statusCode')
.should('eq', 200)
The test waits on the named route after triggering the request, then checks the response status. To use checked-in data instead of an inline response, point the intercept at a fixture:
cy.intercept('GET', '/api/users', { fixture: 'users.json' }).as('getUsers')
Cypress supports serving fixture data through cy.intercept(), so this pattern does not require a live API response. Keep the route in the test that needs it or in a beforeEach hook: Cypress automatically clears intercepts before each test.
Rank #2
Add a polyfill only for an application browser-support requirement
- Check the supported browser matrix. Confirm that the application must run in an environment without native
fetch. If all supported browsers provide it, a test-only polyfill is unnecessary and can hide a mismatch between the test and real runtime. - Choose a package for your app. The right package and import syntax depend on the project’s browser targets and bundler; Cypress does not prescribe a particular third-party polyfill in the guidance covered here.
- Load it through the application’s normal dependency and build process. Ensure it runs before any module or startup code that calls
fetch. This keeps the application’s test behavior aligned with its production runtime. - Continue to intercept requests separately. Use
cy.intercept()to control the resulting HTTP request or response whether the app uses native fetch or a polyfilled implementation.
Do not assume that importing a package into Cypress’s support file installs it on the application-under-test (AUT) window. The support bundle is test setup, distinct from the app’s runtime. If you use a test-only pre-load hook, verify that the polyfill is present on the AUT’s window before application startup and before the first request. Cypress’s current official guidance does not give a universal third-party polyfill injection snippet, so the precise integration must match your Cypress version and bundler.
Keep shared Cypress setup focused
Cypress support files run before each spec and can hold shared hooks, but imports there are bundled and loaded for every spec. Keep them lean. Put an application polyfill in the application’s own startup path when the application actually needs it; put shared Cypress test setup in the support file only when it belongs to test setup.
Rank #3
Troubleshoot fetch and interception problems
experimentalFetchPolyfillerrors or has no effect: remove it. It is no longer a supported Cypress configuration option.- The request is not intercepted: define the route before the request-triggering action. Also check browser caching: a response served from the browser cache does not reach the network layer, so
cy.intercept()will not fire for that request. - Fetch fails from Electron’s initial
about:blankpage: Cypress documents that Electron no longer permits fetch or XMLHttpRequest from that page before navigation. Usecy.request()for a direct Cypress-side request, or navigate withcy.visit()first. - The polyfill import appears ineffective: verify that it modifies the AUT’s
window, not just Cypress test setup, and that it runs before app code uses fetch. Confirm the exact hook and bundler behavior for your project rather than relying on a universal injection recipe.
Or skip the browser setup
For capturing a rendered website as an image or PDF, ScreenshotNeo offers a separate screenshot API. This does not replace cy.intercept() or install a fetch polyfill in Cypress; it is an option when the task is to capture a page rather than test its network behavior. One GET request returns a screenshot or PDF. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers indicate the page verdict and billing status.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents. - The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Rank #4
Frequently Asked Questions
How do I intercept a fetch request in Cypress?
Register cy.intercept() before the app action that sends the request, then wait on the route alias. The example above shows an inline response and a fixture alternative.
Does Cypress still support experimentalFetchPolyfill?
No. Remove the obsolete option; current Cypress guidance directs tests to cy.intercept() for handling fetch requests.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




