Storybook: Regression in Angular workspace libraries

Created on 4 Nov 2019  路  4Comments  路  Source: storybookjs/storybook

Describe the bug
When trying to run Storybook in an Angular library (as part of a larger Angular CLI workspace), Storybook now fails to start due to being unable to find angular.json in the current directory (it's in the workspace root).

To Reproduce
Steps to reproduce the behavior:

  1. Have an Angular CLI workspace with a library project
  2. Run Storybook v5.30.0-alpha38 in the library directory
  3. Get TypeError: Cannot read property 'defaultProject' of null

Expected behavior
In v5.25.0, there is no error and Storybook runs from the custom config set in ./.storybook when unable to find an angular.json file.

Code snippets
https://github.com/storybookjs/storybook/commit/1fa78aa5736be43a2f86138bc2374d58ad2c9edb#diff-85c97608923e0cbbc684961efd172cac

This is the commit which broke the functionality. L52 in that file (app/angular/src/server/angular-cli_config.ts) used to exit the entire function of getting the Angular CLI config. Since the functions have been split up, this is no longer the case and the second function (getLeadingAngularCliProject) receives the null value.

System:
Environment Info:

System:
OS: Linux 5.3 Arch Linux undefined
CPU: (4) x64 Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
Binaries:
Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
Yarn: 1.19.1 - /usr/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
Browsers:
Firefox: 69.0.2
npmPackages:
@storybook/addon-a11y: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/addon-actions: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/addon-knobs: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/addon-storysource: ^5.3.0-alpha.38 => 5.3.0-alpha.38
@storybook/angular: ^5.3.0-alpha.38 => 5.3.0-alpha.38

angular bug

Most helpful comment

Thanks for catching that! My commit message contained "improve testability" and yet I haven't tested what I have changed 馃槵 Will fix it asap

All 4 comments

cc @kroeder

Thanks for catching that! My commit message contained "improve testability" and yet I haven't tested what I have changed 馃槵 Will fix it asap

No problem. Thanks for your work on this :)

Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.41 containing PR #8727 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hckhanh picture hckhanh  路  69Comments

EdenTurgeman picture EdenTurgeman  路  81Comments

ChucKN0risK picture ChucKN0risK  路  74Comments

dmmarmol picture dmmarmol  路  57Comments

enagy27 picture enagy27  路  69Comments