I am trying to setup Storybook for Angular 8, however when running npm run storybook
I am getting the following error:
ERROR in /home/user/dev/storybook/src/stories/Button.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Button.stories.ts(2,29):
TS2307: Cannot find module '@storybook/angular/types-6-0'.
ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts(1,32):
TS2307: Cannot find module '@storybook/angular'.
ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Header.stories.ts(4,29):
TS2307: Cannot find module '@storybook/angular/types-6-0'.
ERROR in /home/user/dev/storybook/src/stories/Page.stories.ts
ERROR in /home/user/dev/storybook/src/stories/Page.stories.ts(1,45):
TS2307: Cannot find module '@storybook/angular'.
However, @storybook/angular
is on package.json
and it is installed, as well as the file itself does not prompt any errors when visualizing with vscode. I have tried to use all solutions from google, such as:
@storybook/angular
and not using @storybook/angular/types-6-0
@storybook/angular/types-6-0
to .storybook/typings.d.ts
../src/setupJest.ts
to the exclude array in .storybook/tsconfig.json
"enableIvy": false
to tsconfig.json
under angularCompilerOptions
What am I doing wrong?
just add the following line in "typings.d.ts" that can be found inside the .storybook directory
declare module '@storybook/angular/demo'