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 init: Cannot destructure property 'root' of 'angularJSON.getProjectSettingsByName(...)' as it is undefined #22350

Closed
Tracked by #22243
yannbf opened this issue May 2, 2023 · 7 comments · Fixed by #22663

Comments

@yannbf
Copy link
Member

yannbf commented May 2, 2023

Error location: angular generator

Suggested work:

This is a bug in the way the angular.json file is parsed when initializing Storybook. Could be related to different formats present in different angular versions, or really just lack of better error handling. We should investigate it and fix it. Additionally, we should investigate the feedback from this comment and take into account when improving the error message (or maybe adding an FAQ entry to the docs website).

@valentinpalkovic
Copy link
Contributor

I need a reproduction, otherwise, I don't know how to tackle this issue.

@yannbf
Copy link
Member Author

yannbf commented May 9, 2023

Finding as part of this investigation: We should improve the handling here, as it sends null errors:
https://github.com/storybookjs/storybook/blob/next/code/lib/cli/src/generators/ANGULAR/index.ts#L34

@yannbf
Copy link
Member Author

yannbf commented May 9, 2023

Finding: it's likely that this line of code receives undefined as this.projects[projectName] does not exist:
https://github.com/storybookjs/storybook/blob/next/code/lib/cli/src/generators/ANGULAR/index.ts#L41

@valentinpalkovic
Copy link
Contributor

@yannbf I think you wanted to take this ticket over. Or was it another which we talked about yesterday?

@yannbf
Copy link
Member Author

yannbf commented May 10, 2023

@valentinpalkovic you could take it if you'd like, especially if you know more about angular.json formats over angular versions!

@shilman
Copy link
Member

shilman commented May 22, 2023

Zoinks!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.13 containing PR #22663 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb@latest upgrade

@shilman
Copy link
Member

shilman commented May 23, 2023

Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.21 containing PR #22663 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb@next upgrade --tag future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants