storybook: SB 5.2 Typescript build fail - (Addon-knobs)

I’m running into a couple of issues when updating to 5.2.

Both errors seem to be caused by the addon knobs package.

  1. Complains about a missing dep (manually installing @types/react-color fixes this one)
ERROR in [at-loader] ./node_modules/@storybook/addon-knobs/dist/components/types/Color.d.ts:3:29 
    TS7016: Could not find a declaration file for module 'react-color'. '/Users/sami/Apps/components/node_modules/react-color/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/react-color` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-color';`
  1. Second complains about a missing export
ERROR in [at-loader] ./node_modules/@types/storybook__addon-knobs/index.d.ts:13:10 
    TS2305: Module '"../../../../../../../Users/sami/Apps/components/node_modules/@storybook/react/dist/client"' has no exported member 'RenderFunction'.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 16
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@sami616 Ergh. Will release a fix in the next hr

@types/storybook__react is now also not needed?

i think so. but still seeing webpack-env when i have uninstall @types/storybook__react.

If anyone gets blocked by this, I can recommend adding skipLibCheck: true to your tsconfig.json - because the internal typings of Storybook don’t really matter that much to the type safety of your application code.

They can delete the dep on those types now.

Yee-haw!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.2 containing PR #8118 that references this issue. Upgrade today to try it out!

@shilman can we release a patch containing this?