Sarthik Gupta
Sarthik Gupta

Reputation: 983

StoryBook Angular - ERR! => Could not get angular cli webpack config

Upon executing npm run storybook, the process fails with the following error:

ERR! => Could not get angular cli webpack config

Upvotes: 0

Views: 1478

Answers (2)

TomRaaff
TomRaaff

Reputation: 83

I had the same isssue. The fix for me was to specifically name the paths of 'root' and 'sourceRoot' in the angular.json file.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "storybook": {
      "projectType": "application",
      "sourceRoot": "projects/my-lib/src/lib",
      "root": "projects/my-lib",
      "architect": {
         ...
      },
    ...
    },
  ...
  },
}

Upvotes: 2

Sarthik Gupta
Sarthik Gupta

Reputation: 983

This error usually happens upon additional source being added for assets in the angular.json file.

Fix:

  1. Remove additional sources from assets under angular.json

  2. Open package.json and edit the storybook script as follows:

    "storybook": "npm run docs:json && start-storybook -p 6006 -s projects/"

Upvotes: -1

Related Questions