You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue where Vitest fails to access its internal state when I run my application using yarn web.
The error message suggests that Vitest is being imported directly without running the vitest command, or that it's being imported inside a globalSetup function.
However, I'm not doing either of these things in my code.
I have another test file that is working fine, so the issue seems to be specific to one test file (blocklist.view-model.test.ts). The error occurs in the browser console when I run yarn web.
Reproduction
You can find the repository at [https://github.com/amehmeto/TiedSiren].
The issue can be reproduced by running yarn web and checking the browser console.
The problematic test file is blocklist.view-model.test.ts in the src/react-view/screens/Blocklists/BlocklistScreen/ directory.
Stack trace from Opera Browser when trying to run yarn start web
Uncaught Error: Vitest failed to access its internal state.
One of the following is possible:
- "vitest" is imported directly without running "vitest" command
- "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)
- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues
at getWorkerState (global.CkGT_TMy.js:5:1)
at getCurrentEnvironment (global.CkGT_TMy.js:19:1)
at createExpect (vi.JYQecGiw.js:388:1)
at ./node_modules/vitest/dist/vendor/vi.JYQecGiw.js (vi.JYQecGiw.js:426:1)
at __webpack_require__ (bootstrap:22:1)
at fn (hot module replacement:61:1)
at ./src/react-view/screens/Blocklists/BlocklistScreen/blocklist.view-model.test.ts (BlocklistScreen.tsx:83:1)
at __webpack_require__ (bootstrap:22:1)
at fn (hot module replacement:61:1)
at ./src/react-view/screens/Blocklists/BlocklistScreen/blocklist.view-model.ts (blocklist.view-model.test.ts:76:1)
### Used Package Manager
yarn
### Validations
- [X] Follow our [Code of Conduct](https://github.com/vitest-dev/vitest/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitest.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vitest/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vitest/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm encountering an issue where Vitest fails to access its internal state when I run my application using yarn web.
The error message suggests that Vitest is being imported directly without running the vitest command, or that it's being imported inside a globalSetup function.
However, I'm not doing either of these things in my code.
I have another test file that is working fine, so the issue seems to be specific to one test file (blocklist.view-model.test.ts). The error occurs in the browser console when I run yarn web.
Reproduction
You can find the repository at [https://github.com/amehmeto/TiedSiren].
The issue can be reproduced by running
yarn web
and checking the browser console.The problematic test file is blocklist.view-model.test.ts in the src/react-view/screens/Blocklists/BlocklistScreen/ directory.
System Info
Stack trace from Opera Browser when trying to run
yarn start web
The text was updated successfully, but these errors were encountered: