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

[client-api] Typescript error due to missing types include #11161

Closed
fernandopasik opened this issue Jun 13, 2020 · 7 comments
Closed

[client-api] Typescript error due to missing types include #11161

fernandopasik opened this issue Jun 13, 2020 · 7 comments

Comments

@fernandopasik
Copy link
Member

Describe the bug
When checking types on my own project where I use storybook it runs an error indicating that a type of a library used by storybook is missing and treats it like "any"

To Reproduce
run tsc --noEmit in a project that uses storybook

Expected behavior
No errors

Screenshots

$ tsc --noEmit -p tsconfig.all.json
node_modules/@storybook/client-api/dist/queryparams.d.ts:1:16 - error TS7016: Could not find a declaration file for module 'qs'. '/hello-web-components/node_modules/qs/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/qs` if it exists or add a new declaration (.d.ts) file containing `declare module 'qs';`

1 import qs from 'qs';
                 ~~~~


Found 1 error.

Additional context
Latest storybook beta version

@fernandopasik
Copy link
Member Author

fernandopasik commented Jun 13, 2020

The solution proposed is to add @types/qs to dependencies in https://github.com/storybookjs/storybook/blob/next/lib/client-api/package.json#L42

@fernandopasik
Copy link
Member Author

An example where this didn't happen and has that types library
https://github.com/storybookjs/storybook/blob/next/addons/links/package.json

@fernandopasik
Copy link
Member Author

fixed by #11162

@shilman
Copy link
Member

shilman commented Jun 15, 2020

@fernandopasik our convention is to close the issues once the fix is released, which happens automatically in my release script if the first line of the PR includes a reference to the issue, e.g. #XXXX or a URL. So no need to close the issue by hand.

@fernandopasik
Copy link
Member Author

@shilman sorry about that, thanks for the clarification, won't happen again

@shilman
Copy link
Member

shilman commented Jun 15, 2020

@fernandopasik no problem! ❤️

@shilman
Copy link
Member

shilman commented Jun 15, 2020

Huzzah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.28 containing PR #11162 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

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

No branches or pull requests

2 participants