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
Cannot read property "fireChangeEvent" of undefined when stubbing with route2 in Chrome #9170
Comments
Interestingly enough this error does not occur every time!
Then with the automatic retry, it works again. |
This error is being thrown from here: https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cy/net-stubbing/events/request-received.ts#L145:L145 Since this error is intermittent, it will be harder to track down. A reproducible example would be ideal to help us. |
I know a repro repo would be nice, since this is one of those "sometimes" bugs it's very hard to reproduce in an isolated shareable use case. Whenever I have some spare time I will try to create a similar test case. But again, I call the exact same helper method in all tests and only for one specific test it sometimes fails on the first try (and only the first try). So reproducing that is really not easy I think... |
a can reproduce this bug when i'm logging in to my app with different users via cypress and then waiting for same route2 aliases, then couple times stop test and begin again |
Hi @IgorPahota |
I have had the exact same problem with route2 in 5.6.0 and with intercept in 6.0.0 |
That's a really good catch @fearhq! This would also explain why the test always succeeds on the second try! My guess would be that the test breaks if a request of a preceding test hasn't terminated. |
same issue here. waiting for some shiny fixes ;) |
I wanted to add that this is not the only error I get with intercept |
I am also seeing this same intermittent error since switching from route to intercept. |
@MartijnHols Thank you for that suggestion. clearing the cookies so far seems to be working for me. I haven't had a failure since. |
@MartijnHols fixed problem for me as well. It also fixed the problem, when sometimes cy.visit() was not fired at beforeEach(). |
The code for this is done in cypress-io/cypress#9425, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
I am stubbing many (all) server calls for testing our web-app without the real server. As the server is not reachable, I also have to stub OPTIONS-method http calls.
My code looks something like this:
In many cases this works without any problem. With one specific test, I get this error:
Cypress tells me that this error originates from my test code and not from cypress itself. If that is true, I am very sorry for opening this issue. But in this case, I think this might be a bug in the experimental full network stubbing feature, especially since this problem only occurs in Chromium!
The error is thrown in this code excerpt in the cypress_runner.js:
Any idea why "log" is missing in some cases?
Desired behavior
No exception when (an OPTIONS) http call is intercepted.
Test code to reproduce
Sadly, I cannot share the project that this error occurred in, I might be able to reproduce this in a fresh repo, if required I will add that later.
Versions
Found in:
Cypress 5.6.0
Chrome 86 & Edge Dev 88
Windows 10
Works in Firefox 80
The text was updated successfully, but these errors were encountered: