question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storybook run fail on workspace basing on workspace.json instead of angular.json due to lack of some config entries

See original GitHub issue

Current Behavior

Workspace has only workspace.json file (no angular.json)

> nx run swo-ng-checkbox-wrapper:storybook
info => Loading presets
info => Loading 1 config file in "/Users/krzysztoforkiszswo/dev/orkisz/ng-react-mix-nx/libs/swo-ng/checkbox-wrapper/.storybook"
info => Loading 8 other files in "/Users/krzysztoforkiszswo/dev/orkisz/ng-react-mix-nx/libs/swo-ng/checkbox-wrapper/.storybook"
info => Adding stories defined in "/Users/krzysztoforkiszswo/dev/orkisz/ng-react-mix-nx/libs/swo-ng/checkbox-wrapper/.storybook/main.js"
info => Found custom tsconfig.json
info => Using implicit CSS loaders
info => Loading angular-cli config
info => Using angular project "swo-ng-progress-bar:build" for configuring Storybook
ERR! => Could not get angular cli webpack config
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined


          Broken build, fix the error above.
          You may need to refresh the browser.


β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

>  NX   ERROR  Running target "swo-ng-checkbox-wrapper:storybook" failed

  Failed tasks:

  - swo-ng-checkbox-wrapper:storybook

  Hint: run the command with --verbose for more details.

Take a look that it also tries to invoke default project build, not those I’m interested in

Expected Behavior

Storybook runs normally

Steps to Reproduce

In this commit I added some necessary props to workspace.json: https://github.com/orkisz/ng-react-mix-nx/tree/b5d28bcde242041267debdede95c9698034d5c91 just checking out previous commit will show the error. I assume Storybook integration needs info that exists in angular.json (tsConfig and angularBrowserTarget) but because of some convention is not necessary for NX

Failure Logs

Environment

Node : 14.17.6 OS : darwin x64 yarn : 1.22.11

nx : 12.9.0 @nrwl/angular : 12.9.0 @nrwl/cli : 12.9.0 @nrwl/cypress : 12.9.0 @nrwl/devkit : 12.9.0 @nrwl/eslint-plugin-nx : 12.9.0 @nrwl/express : Not Found @nrwl/jest : 12.9.0 @nrwl/linter : 12.9.0 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : 12.9.0 @nrwl/nx-cloud : Not Found @nrwl/react : 12.9.0 @nrwl/schematics : Not Found @nrwl/tao : 12.9.0 @nrwl/web : 12.9.0 @nrwl/workspace : 12.9.0 @nrwl/storybook : 12.9.0 @nrwl/gatsby : Not Found typescript : 4.3.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
juristrcommented, Nov 5, 2021

@junekpavel thanks, will have a look πŸ‘

1reaction
junekpavelcommented, Nov 2, 2021

Hey @juristr and others, I’m having exactly same issue.

After some investigations, I found out, the issue isn’t probably related to workspace.json file name, but rather to the buildable libraries.

I prepared the repo with minimal reproduction https://github.com/junekpavel/nx-sb-demo, including all commands I run to generate it. Notice the --buildable flags when generating libraries - if you run generate libraries without them, the storybook is working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test runner - Storybook
These tests run in a live browser and can be executed via the command line or your CI server. Setup. The test-runner is...
Read more >
Error: Can't resolve 'core-js/es7/reflect' in '\node_modules ...
For Angular 8 (source): Β· 1- open the "polyfills.ts" in your src folder. Β· 2 - find the line where there is a...
Read more >
Set up Storybook for Angular Projects - Nx
Set up Storybook for Angular Projects. This guide will walk you through setting up Storybook for Angular projects in your Nx workspace. Set...
Read more >
Changelog | Finsemble
We've upgraded Finsemble's internal representation of apps from the FDC3 1.2 appD format to FDC3 2.0. Apps configured in the 1.2 format under...
Read more >
Angular coding style guide
File structure conventionslink. Some code examples display a file that has one or more similarly named companion files. For example, hero.component.ts andΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found