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
import React from "react";
import { expect, it } from "vitest";
it("works", () => {
expect(React).not.toBe(undefined);
});
It will fail in browser mode, but will run in CLI mode. I suspect the error happen cause react still using CJS packages and default export is not configured properly for vitest.
### 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
Here is the test:
It will fail in browser mode, but will run in CLI mode. I suspect the error happen cause react still using CJS packages and default export is not configured properly for vitest.
Reproduction
https://github.com/quolpr/vitest-browser-default-import-bug
System Info
The text was updated successfully, but these errors were encountered: