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

Angular Library + Storybook fails out of the box due to unavailable CLI Webpack config #6264

Closed
udos86 opened this issue Jul 6, 2021 · 2 comments

Comments

@udos86
Copy link

udos86 commented Jul 6, 2021

Current Behavior

Running a Storybook for any Angular library in a clean, newly created workspace fails out of the box with the following error message: Could not get angular cli webpack config

Adding and running a storybook for any Angular app works fine, however.

Expected Behavior

Storybook should be working fine for Angular libraries, too.

Steps to Reproduce

  1. npx create-nx-workspace --cli=angular (create empty workspace)
  2. npm i @nrwl/angular @nrwl/storybook -D (install Nrwl packages)
  3. ng g @nrwl/angular:lib demo-lib --publishable --strict --importPath @udos86/demo-lib (create sample lib)
  4. ng g c button --project demo-lib (create sample component)
  5. ng g @nrwl/angular:storybook-configuration demo-lib (create storybook configuration for sample lib)
  6. ng run demo-lib:storybook --verbose (run storybook)

Failure Logs

> nx run demo-lib:storybook
info => Loading presets
info => Loading 1 config file in "D:\dev\nx-sb-cli-ng-empty\libs\demo-lib\.storybook"
info => Loading 8 other files in "D:\dev\nx-sb-cli-ng-empty\libs\demo-lib\.storybook"
info => Adding stories defined in "D:\dev\nx-sb-cli-ng-empty\libs\demo-lib\.storybook\main.js"
info => Found custom tsconfig.json
info => Using implicit CSS loaders
info => Loading angular-cli config
info => Using angular project "demo-lib:build" for configuring Storybook
ERR! => Could not get angular cli webpack config
TypeError: s.startsWith is not a function
    at Object.error (D:\dev\nx-sb-cli-ng-empty\node_modules\@nrwl\tao\src\shared\logger.js:10:15)
    at D:\dev\nx-sb-cli-ng-empty\node_modules\@nrwl\storybook\src\executors\storybook\storybook.impl.js:43:33

Environment

  Node : 14.16.1
  OS   : win32 x64
  npm  : 6.14.12

  nx : Not Found
  @nrwl/angular : 12.5.6
  @nrwl/cli : 12.5.6
  @nrwl/cypress : 12.5.6
  @nrwl/devkit : 12.5.6
  @nrwl/eslint-plugin-nx : 12.5.6
  @nrwl/express : Not Found
  @nrwl/jest : 12.5.6
  @nrwl/linter : 12.5.6
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.5.6
  @nrwl/web : Not Found
  @nrwl/workspace : 12.5.6
  @nrwl/storybook : 12.5.6
  @nrwl/gatsby : Not Found
  typescript : 4.2.4
@udos86
Copy link
Author

udos86 commented Jul 6, 2021

I'm closing this as a potential duplicate of #5688

@udos86 udos86 closed this as completed Jul 6, 2021
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant