Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook 6.0 has type errors in a strict Angular 10.0.6 project #12070

Closed
aloifolia opened this issue Aug 17, 2020 · 2 comments
Closed

Storybook 6.0 has type errors in a strict Angular 10.0.6 project #12070

aloifolia opened this issue Aug 17, 2020 · 2 comments

Comments

@aloifolia
Copy link

Describe the bug
With Angular strict mode enabled, the generated Storybook 6.0 code shows multiple type errors.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Angular project with npx -p @angular/cli ng new storybook-test --strict
  2. In the new folder, install storybook with npx sb init
  3. See 4 error messages:
ERROR in /path/to/project/storybook-test/storybook-test/src/stories/button.component.ts
ERROR in /path/to/project/storybook-test/storybook-test/src/stories/button.component.ts(20,3):
TS2564: Property 'primary' has no initializer and is not definitely assigned in the constructor.

ERROR in /path/to/project/storybook-test/src/stories/button.component.ts
ERROR in /path/to/project/storybook-test/storybook-test/src/stories/button.component.ts(26,3):
TS2564: Property 'backgroundColor' has no initializer and is not definitely assigned in the constructor.

ERROR in /path/to/project/storybook-test/src/stories/button.component.ts
ERROR in /path/to/project/storybook-test/src/stories/button.component.ts(40,3):
TS2564: Property 'label' has no initializer and is not definitely assigned in the constructor.

ERROR in /path/to/project/storybook-test/src/stories/Header.stories.ts
ERROR in /path/to/project/storybook-test/src/stories/Header.stories.ts(27,3):
TS2322: Type '{}' is not assignable to type 'null | undefined'.
  Type '{}' is not assignable to type 'null'.

Expected behavior
The default installation should not show Typescript errors.

System:

Environment Info:

I am using Angular 10.0.6.

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 13.12.0 - ~/.nvm/versions/node/v13.12.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v13.12.0/bin/npm
  Browsers:
    Chrome: 84.0.4147.125
    Firefox: 77.0.1
    Safari: 13.1
  npmPackages:
    @storybook/addon-actions: ^6.0.5 => 6.0.5 
    @storybook/addon-essentials: ^6.0.5 => 6.0.5 
    @storybook/addon-links: ^6.0.5 => 6.0.5 
    @storybook/angular: ^6.0.5 => 6.0.5 
@aloifolia aloifolia changed the title Storybook 6.0 has type errors in an Angular 10.0.6 Storybook 6.0 has type errors in a Angular 10.0.6 project Aug 17, 2020
@aloifolia aloifolia changed the title Storybook 6.0 has type errors in a Angular 10.0.6 project Storybook 6.0 has type errors in a strict Angular 10.0.6 project Aug 17, 2020
@shilman
Copy link
Member

shilman commented Aug 17, 2020

cc @tooppaaa @gaetanmaisse

@shilman
Copy link
Member

shilman commented Aug 17, 2020

Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.12 containing PR #12081 that references this issue. Upgrade today to try it out!

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants