Component testing - error `Performance.mark: Global object is unavailable`
See original GitHub issueCurrent behavior
After modifying cypress config ; When reloading a component test (ie. making a change in a component or in spec file and saving the file) then the error Performance.mark: Global object is unavailable
will appear in the spec window:
Reloading the page will fix the issue.
Desired behavior
No error
Test code to reproduce
- Clone repo https://gitlab.com/souf/react-webpack-playground/-/tree/cypress-reload-error using branch
cypress-reload-error
- run
yarn install
andyarn cypress:open
. - open component testing for
App
. - change something in the cypress config in
/cypress.config.js
for example the value ofdefaultCommandTimeout
. - open file /src/components/App.jsx change the “Hello” string and save to trigger a reload.
Error message should occur.
Cypress Version
10.4.0
Other
Using react+webpack setup. Only tested on firefox linux
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Jest test fails : TypeError: window.matchMedia is not a ...
In this project, I'm using Jest snapshot testing and got an error TypeError: window.matchMedia is not a function inside my component. I go ......
Read more >Testing and error handling patterns in Next.js
Check out these different ways to run tests and handle errors in Next.js apps using Cypress, a JavaScript-based testing framework.
Read more >Component testing scenarios
Error : This test module uses the component BannerComponent which is using a "templateUrl" or "styleUrls", but they were never compiled.
Read more >Global variables not working in runtime - NI Community
I have written a testing app for integration with a Solartron 1260 and 1287. The problem is that I used some global variables...
Read more >The 10 Most Common JavaScript Issues Developers Face
That's why JavaScript issues, and finding the mistakes that cause them, are at the ... and all the variables in the closure scope);...
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
Hi @gsouf, thank you for the detailed steps to reproduce and especially for the clonable repo. I was able to confirm the behavior you reported on both Firefox 101 and Chrome 104. We will now route this to the appropriate team to fix 🎉 🙏
@AtofStryker yes I confirm it happens everytime.
I was also able to setup chrome today and I confirm the issue also exists in chrome (google chrome stable downloaded today). But the issue is slightly different. There is no error message but no success message either (see screenshot bellow), nothing in the dev tools console either and at this point the chrome is frozen. You can see the “run all specs button” is still in the “square icon” status. Reloading the page or trying to close browser does not work.
That’s a behavior I have noticed on chrome linux many times when javascript code hangs.
All I can do at this point is to close the cypress process to get chrome to close.