Shubham Aggarwal
Shubham Aggarwal

Reputation: 80

Storybook is giving "Can't resolve all parameters for AppComponent" error in angular library

Storybook is giving "Can't resolve all parameters for AppComponent" with angular 8 library setup

I have already tried adding "import 'core-js/es7/reflect'" in test.ts

Steps to reproduce:

  1. ng new demo --createApplication=false
  2. ng g library demo -p d
  3. npx -p @storybook/cli sb init
  4. npm run storybook

getting "Can't resolve all parameters for AppComponent" in browser console.

Upvotes: 4

Views: 1658

Answers (3)

phng
phng

Reputation: 352

I have a similar problem. "I" cant resolve all parameters for a ts file that holds one of the first @Effects(). But this file is loaded into a module that is loaded into the app module. And I am loading the app module in a story via imports. The emitDecoratorMetadata is set to true in both tsconfig files.

moduleMetadata({
  imports: [AppModule],
  providers: [],
  declarations: [AppComponent]
})

Upvotes: 0

Brendan Rice
Brendan Rice

Reputation: 54

Adding "emitDecoratorMetadata": true to tsconfig.json worked for me.

Upvotes: 1

Arthur
Arthur

Reputation: 111

Try downgrading your storybook dependencies 5.1.9 worked for me.

There is probably a bug in @storybook/angular 5.1.10

Upvotes: 5

Related Questions