Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start Storybook with Angular

I have an existing project where I plan to enable storybook.

What I did was:

npx -p @storybook/cli sb init --type angular

When I start the project I see theese errros:

ERROR in .../src/stories/0-Welcome.stories.ts
ERROR in .../src/stories/0-Welcome.stories.ts(1,25):
TS2307: Cannot find module '@storybook/angular/demo'.

But modules are there and code suggest is working fine.

My Package.json

"@storybook/addon-actions": "^5.3.17",
    "@storybook/addon-links": "^5.3.17",
    "@storybook/addon-notes": "^5.3.17",
    "@storybook/addons": "^5.3.17",
    "@storybook/angular": "^5.3.17",
    "sass-loader": "^7.1.0",
"@angular/animations": "~8.2.5",
    "@angular/common": "~8.2.5",
    "@angular/compiler": "~8.2.5",
    "@angular/core": "~8.2.5",
    "@angular/forms": "~8.2.5",
    "@angular/platform-browser": "~8.2.5",
    "@angular/platform-browser-dynamic": "~8.2.5",
    "@angular/platform-server": "~8.2.5",
    "@angular/router": "~8.2.5",
    "@angular/service-worker": "~8.2.5",

There are no similar issues according to goole :) any idea?

like image 753
Fribu - Smart Solutions Avatar asked Mar 19 '20 09:03

Fribu - Smart Solutions


1 Answers

just add the follow line in "typings.d.ts" that can be found inside the .storybook directory

declare module '@storybook/angular/demo'
like image 138
Redtxai Avatar answered Oct 29 '22 09:10

Redtxai