Description
Describe the bug
In my project, type checking of args doesn't work, it never shows any type errors, and the type of props for the render function fails to be inferred, giving an error about being inferred as any
.
By starting small with https://github.com/elite174/storybook-solid-js and changing things I was able to reproduce it when enabling yarn plug-n-play.
A workaround is to explicitly install the @storybook/types
dependency, which I can't find documented anywhere. No idea why or how that works, but it seems to fix the errors. There are still a bunch of type errors in storybook-solidjs/dist/index.d.ts
, but they can be silenced with "skipLibCheck": true
in the tsconfig.
Steps to reproduce the behavior
- Clone elite174/storybook-solid-js (elite174/storybook-solid-js@b4eee6a at the time of writing issue)
yarn set version 4.1.1
- this sets yarn as the package manager and using PnP- Change
typescript
to use exactly version "5.3.2" in package.json - it has issues unrelated to storybook >= 5.4 yarn install
yarn dlx @yarnpkg/sdks vscode
then in vscode, select typescript version use workspace through yarn, make sure it's 5.3.2- Fix the first line of
Counter.stories.tsx
to use "storybook-solidjs" - Add what should be a type error in one of the args, and observe no error
Expected behavior
props
should be inferred to have type CounterProps
and args
and argTypes
should show typescript errors for incorrect properties.
Screenshots and/or logs
Actual:
Expected:
If applicable, add screenshots and/or logs to help explain your problem.
Environment
- OS: linux64
- Node.js version: 21.6.2
- YARN version: 4.1.1
- Browser (if applicable):
- Browser version (if applicable):
- Device (if applicable):
Additional context
Add any other context about the problem here.