storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.95k stars 9.22k forks source link

[Bug]: node_modules/@storybook/components/dist/index.d.ts type error #22232

Open jeremytenjo opened 1 year ago

jeremytenjo commented 1 year ago

Describe the bug

node_modules/@storybook/components/dist/index.d.ts type error

./node_modules/@storybook/components/dist/index.d.ts:283:8
Type error: Type '"async" | "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "height" | "translate" | "width" | "multiple" | "disabled" | "cite" | "data" | ... 345 more ... | "rev"' does not satisfy the constraint '"async" | "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "height" | "translate" | "width" | "multiple" | "disabled" | "cite" | "data" | ... 345 more ... | "valid"'.
  Type '"rev"' is not assignable to type '"async" | "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "height" | "translate" | "width" | "multiple" | "disabled" | "cite" | "data" | ... 345 more ... | "valid"'.

  281 |         valid?: ValidationStates;
  282 |         height?: number;
> 283 |     }, "download" | "href" | "hrefLang" | "media" | "target" | "type" | "form" | "list" | "cite" | "cellPadding" | "cellSpacing" | "summary" | "width" | "alt" | "crossOrigin" | "heigh

To Reproduce

  1. run git clone https://github.com/jeremytenjo/starter-website --branch storybookv7/type-error && cd starter-website && npm i && npm run build

  2. check terminal

image

System

Environment Info:

  System:
    OS: macOS 13.3.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
  Browsers:
    Chrome: 112.0.5615.137
    Firefox: 95.0.2
    Safari: 16.4
  npmPackages:
    @storybook/addon-actions: 7.0.7 => 7.0.7 
    @storybook/addon-essentials: 7.0.7 => 7.0.7 
    @storybook/addon-interactions: 7.0.7 => 7.0.7 
    @storybook/addon-links: 7.0.7 => 7.0.7 
    @storybook/builder-webpack5: 7.0.7 => 7.0.7 
    @storybook/jest: 0.1.0 => 0.1.0 
    @storybook/nextjs: 7.0.7 => 7.0.7 
    @storybook/test-runner: 0.10.0 => 0.10.0 
    @storybook/testing-library: 0.1.0 => 0.1.0 


### Additional context

_No response_
ToneyPK commented 1 year ago

Problem still present in version 7.0.22

Davidihl commented 9 months ago

Unfortunately I experience this bug in 7.6.4 as well

valentinpalkovic commented 9 months ago

The error can temporarily be skipped if "skipLibCheck": true, is set in your tsconfig.json:

{
  "compilerOptions": {
    "skipLibCheck": true,
  }
}

Parts of the error also correlate to your @types/react version. Please upgrade it and all Storybook dependencies to the latest version.