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 12 fails with webpack exception #15603

Closed
tomsontom opened this issue Jul 15, 2021 · 3 comments
Closed

Angular 12 fails with webpack exception #15603

tomsontom opened this issue Jul 15, 2021 · 3 comments

Comments

@tomsontom
Copy link

Describe the bug
I followed a tutorial (https://dev.to/activenode/angular-10-storybook-npm-package-ng-design-system-step-by-step-2dn2) to setup a angular libary project with storybook but it fails with the following exception

ERR! => Could not get angular cli webpack config
ERR! TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
ERR!     at validateString (internal/validators.js:124:11)
ERR!     at Object.resolve (path.js:980:7)
ERR!     at /Users/tomschindl/.../.../.../node_modules/@storybook/angular/dist/ts3.9/server/angular-devkit-build-webpack.js:140:47

System

Environment Info:

  System:
    OS: macOS 11.4
    CPU: (8) x64 Apple M1
  Binaries:
    Node: 14.15.4 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.10 - /usr/local/bin/npm
  Browsers:
    Chrome: 91.0.4472.114
    Firefox: 89.0
    Safari: 14.1.1
  npmPackages:
    @storybook/addon-actions: ^6.3.4 => 6.3.4 
    @storybook/addon-essentials: ^6.3.4 => 6.3.4 
    @storybook/addon-links: ^6.3.4 => 6.3.4 
    @storybook/angular: ^6.3.4 => 6.3.4 
    @storybook/builder-webpack5: ^6.3.4 => 6.3.4 
    @storybook/manager-webpack5: ^6.3.4 => 6.3.4 
@tomsontom
Copy link
Author

So i instrumented the code a bit and i think the problem is that the library project in angular.json looks like this

...
    "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:ng-packagr",
          "options": {
            "project": "projects/..../ng-package.json"
          },
          "configurations": {
            "production": {
              "tsConfig": "projects/.../tsconfig.lib.prod.json"
            },
            "development": {
              "tsConfig": "projects/.../tsconfig.lib.json"
            }
          },
          "defaultConfiguration": "production"
        },

So the options does not contain tsConfig

@Marklb
Copy link
Member

Marklb commented Jul 15, 2021

I think this is the same as #15246.

@tomsontom
Copy link
Author

That's right

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

No branches or pull requests

3 participants