Skip to content
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

[Bug]: vitest version used by @storybook/test pollutes global Object type #25298

Closed
Talor-A opened this issue Dec 21, 2023 · 0 comments · Fixed by #25576
Closed

[Bug]: vitest version used by @storybook/test pollutes global Object type #25298

Talor-A opened this issue Dec 21, 2023 · 0 comments · Fixed by #25576

Comments

@Talor-A
Copy link

Talor-A commented Dec 21, 2023

Describe the bug

this is an upstream bug in vitest, that can be fixed by using vitest version greater than 1.1.0 and removing @types/chai from @storybook/test dependencies.

@types/chai pollutes the global Object type by adding a should method. this breaks typechecking on any regular objects with a should property (such as query builder objects).

the issue is described in detail here vitest-dev/vitest#2118

To Reproduce

see the above link for the upstream issue.

System

Storybook Environment Info:

  System:
    OS: macOS 14.1.1
    CPU: (10) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    pnpm: 8.5.1 - ~/.nvm/versions/node/v20.9.0/bin/pnpm <----- active
  Browsers:
    Chrome: 120.0.6099.109
    Safari: 17.1
  npmPackages:
    @storybook/addon-actions: ^7.6.6 => 7.6.6 
    @storybook/addon-essentials: ^7.6.6 => 7.6.6 
    @storybook/addon-interactions: ^7.6.6 => 7.6.6 
    @storybook/addon-links: ^7.6.6 => 7.6.6 
    @storybook/addon-themes: ^7.6.6 => 7.6.6 
    @storybook/addons: ^7.6.6 => 7.6.6 
    @storybook/nextjs: ^7.6.6 => 7.6.6 
    @storybook/react: ^7.6.6 => 7.6.6 
    @storybook/test: ^7.6.6 => 7.6.6 
    @storybook/theming: ^7.6.6 => 7.6.6 
    eslint-plugin-storybook: ^0.6.15 => 0.6.15 
    storybook: ^7.6.6 => 7.6.6 
    storybook-addon-swc: ^1.2.0 => 1.2.0

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants