Closed DanielRoodzant closed 2 months ago
These event listeners and timers need to be cleaned up by you - they are automatically removed when component unmounts, but you say they are called globally
I do not call any listeners globally. Where did you read that from? I will edit it for clarification.
@sheremet-va Any other thoughts that could be of help?
We get this randomly in CI and I have no idea why
Like at some point it works but....
We are using isolated forks
Hello @DanielRoodzant. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction
will be closed if they have no activity within 3 days.
Again, this looks like a user error. Some code somewhere is not cleaned-up properly.
Describe the bug
When running vitest locally or in a pipeline I often get the following (or similar) errors:
The errors do not occur every time tests are run and happen on multiple different files. The associated package displayed on the first line of the stack trace is a private utility package that my project uses. My running theory is that the errors are caused by hanging event listeners and timers. The Document error for example, is caused by the
addChangeListener
function from the universal-cookie package that vueUse uses for itsUseCookies
implementation.My Vite config has the following test configuration:
I have tried mocking the functions that the errors occur on in a setup.ts file. But so far that has not solved the issue.
Reproduction
I have not been able to reproduce the problem in other projects.
Please let me know if I need to provide additional information.
System Info
Used Package Manager
npm
Validations