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] Typescript args type does not work by default with yarn PnP #8

Open
olivercoad opened this issue Apr 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@olivercoad
Copy link

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

  1. Clone elite174/storybook-solid-js (elite174/storybook-solid-js@b4eee6a at the time of writing issue)
  2. yarn set version 4.1.1 - this sets yarn as the package manager and using PnP
  3. Change typescript to use exactly version "5.3.2" in package.json - it has issues unrelated to storybook >= 5.4
  4. yarn install
  5. yarn dlx @yarnpkg/sdks vscode then in vscode, select typescript version use workspace through yarn, make sure it's 5.3.2
  6. Fix the first line of Counter.stories.tsx to use "storybook-solidjs"
  7. 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:

image

Expected:

Unsaved Image 1

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.

@olivercoad olivercoad added the bug Something isn't working label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant