-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 properties of undefined (reading 'undefined') in historyNavigationTriggeredHashChange #20539
Comments
Can you include a reproducible example or example repo so we can reproduce your issue? Unfortunately we will have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please comment in this issue with a reproducible example and we will consider reopening the issue. Thanks! |
Unfortunately that won't be possible since I have complicated tests for a complicated proprietary app. However, I can repro this problem 100% of the time locally, so I'm happy to gather extra debugging information for you if you give me some guidance. |
I had this same issue yesterday and I now have it working. For me it was because of one of two things:
I have it working now by merging the two tests, like so:
Or... 2. Cypress is sometimes flakey when moving between pages, spread across tests. A bit of background: I'm using NextJs and between the tests I'm moving from one NextJs page to another and back. Putting these transitions into one test solves the problem. (I had read something about it. But I can no longer find it. Sorry.) Anyway, I hope this helps you get closer to a solution! Happy hacking! |
Yes, this is similar to what I encountered too. My test suite also moves across a lot of pages via several tests, and then pops the entire browser stack by using the browser's back button (in a separate test). The test passes just fine in our CI, which is running Chrome 95 on Linux, but the test fails for me locally on my laptop, which is running Chrome 99 on Windows 10. Cypress 9.5.0 is being used in both cases. It's unclear if the OS version or Chrome version is causing a difference in behavior. I suppose if I start running into this issue in our CI in the future, I'll try combining all the test logic into a single test and see if that helps. Thanks @DiegoMcDipster! |
I'm seeing this a lot more in Chrome 100, both in Windows 10 and Linux. My test can actually repro this 100% of the time in Cypress 9.5.0. I think this should be reopened. |
@DiegoMcDipster I implemented your suggestion (combining all tests into one) and it fixed the problem! Hopefully this helps others who stumble upon this. There's a workaround available but the root issue should still be fixed in Cypress. |
I'm having this issue too, but it's not only in cypress 9.5.x, I'm seeing it all the way back to version 9.2. 9.1.1 works as expected. That said, I think this may be related to Chrome 100. In 9.5.3 I can run the same tests in FIrefox and they all pass. Hopefully that helps. |
Experiencing a similar issue with tests that involve page transitions. This was with both 9.5.3 and 9.5.2. The previous version (9.1.0) worked. The workaround was to suppress the exception, but this could hide other valid issues, so not a good solution. I hope we get a fix for this.
|
This is still happening in Cypress After digging into the const urls = state('urls');
const urlPosition = state('urlPosition');
const currentUrl = _cypress_location__WEBPACK_IMPORTED_MODULE_0__[/* $Location */ "a"].create(urls[urlPosition]); Both |
The code for this is done in cypress-io/cypress#20948, 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
We have a Cypress test which tests UI navigation by clicking links, then using the browser's back button to pop the history stack. When running this test in Cypress 9.5.0, we get a stack trace from Cypress code:
Desired behavior
No stack trace.
Test code to reproduce
N/A
Cypress Version
9.5.0
Other
No response
The text was updated successfully, but these errors were encountered: