Storybook: [Angular 8.1.2] Can't resolve all parameters for AppComponent: (?, ?, [object Object]).

Created on 2 Aug 2019  路  4Comments  路  Source: storybookjs/storybook

Describe the bug
Unable to create story, I'm using Angular 8.1.2 and Storybook 5.1.10

To Reproduce
Steps to reproduce

  1. Install Storybook npx -p @storybook/cli sb init --type angular
  2. Run Storybook npm run storybook
  3. See error Can't resolve all parameters for AppComponent: (?, ?, [object Object]).

Expected behavior
Story works well

Screenshots
image

Code snippets

import { storiesOf } from '@storybook/angular';
import { Button } from '@storybook/angular/demo';

storiesOf('Button', module)
  .add('with text', () => ({
    component: Button,
    props: {
      text: 'Hello Button',
    },
  }));

System:

  System:
    OS: macOS 10.14.2
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Binaries:
    Node: 12.7.0 - /usr/local/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.10.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 75.0.3770.142
    Safari: 12.0.2
  npmGlobalPackages:
    @storybook/cli: 4.0.12
angular question / support

Most helpful comment

This may solve your issue #7457 (comment)

All 4 comments

This may solve your issue #7457 (comment)

@thandaanda It works! Thank you so much.

For anyone else lurking - pop that in your compilerOptions and that should work a treat. As it did for me - thanks @thandaanda !

i have added "emitDecoratorMetadata": true in .storybook/tsconfig.json

{
  "extends": "../tsconfig.app.json",
  "compilerOptions": {
    "types": [
      "node"
    ],
    "emitDecoratorMetadata": true
  },
  "exclude": [
    "../src/test.ts",
    "../src/**/*.spec.ts",
    "../projects/**/*.spec.ts"
  ],
  "include": [
    "../src/**/*",
    "../projects/**/*"
  ]
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

miljan-aleksic picture miljan-aleksic  路  3Comments

sakulstra picture sakulstra  路  3Comments

Jonovono picture Jonovono  路  3Comments

rpersaud picture rpersaud  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments