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

Stencil - adding Angular outputtarget throws Cannot read properties of undefined (reading 'kind') #1056

Open
sfosterdiscovery opened this issue Nov 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@sfosterdiscovery
Copy link

Describe the bug
A clear and concise description of what the bug is.
When attempting to add the angular outputtarget under v17, the following error is thrown: Cannot read properties of undefined (reading 'kind')

To Reproduce
Steps to reproduce the behavior:
setup NX ( an Angular 17 monorepo) to the following versions:

   Node   : 18.15.0
   OS     : darwin-x64
   npm    : 9.5.0
   
   nx (global)        : 17.1.3
   nx                 : 17.1.3
   @nx/js             : 17.1.3
   @nx/jest           : 17.1.3
   @nx/linter         : 17.1.3
   @nx/eslint         : 17.1.3
   @nx/workspace      : 17.1.3
   @nx/angular        : 17.1.3
   @nx/cypress        : 17.1.3
   @nx/devkit         : 17.1.3
   @nx/eslint-plugin  : 17.1.3
   @nx/react          : 17.1.3
   @nx/storybook      : 17.1.3
   @nrwl/tao          : 17.1.3
   @nx/web            : 17.1.3
   @nx/webpack        : 17.1.3
   typescript         : 5.3.2
   ---------------------------------------
   Community plugins:
   @nxext/stencil     : 17.0.2
   @storybook/angular : 7.6.0

Add stencil plugin then attempt to add the target with:
nx g @nxext/stencil:add-outputtarget design-system --verbose

Expected behavior
A clear and concise description of what you expected to happen.
Output target should be created successfully.

Additional context
Add any other context about the problem here.

Full stack trace of error:

TypeError: Cannot read properties of undefined (reading 'kind')
    at _angularImportsFromNode (/Users/sfoster/Documents/GitHub/foundry/node_modules/@nxext/stencil/src/utils/angular-ast-utils.js:13:16)
    at /Users/sfoster/Documents/GitHub/foundry/node_modules/@nxext/stencil/src/utils/angular-ast-utils.js:56:24
    at Array.map (<anonymous>)
    at getDecoratorMetadata (/Users/sfoster/Documents/GitHub/foundry/node_modules/@nxext/stencil/src/utils/angular-ast-utils.js:56:10)
    at _addSymbolToNgModuleMetadata (/Users/sfoster/Documents/GitHub/foundry/node_modules/@nxext/stencil/src/utils/angular-ast-utils.js:94:19)
    at addDeclarationToModule (/Users/sfoster/Documents/GitHub/foundry/node_modules/@nxext/stencil/src/utils/angular-ast-utils.js:215:12)
    at addLibraryDirectives (/Users/sfoster/Documents/GitHub/foundry/node_modules/@nxext/stencil/src/generators/add-outputtarget/add-angular/generator.js:61:65)
    at /Users/sfoster/Documents/GitHub/foundry/node_modules/@nxext/stencil/src/generators/add-outputtarget/add-angular/generator.js:73:9
    at Generator.next (<anonymous>)
    at fulfilled (/Users/sfoster/Documents/GitHub/foundry/node_modules/tslib/tslib.js:166:62)
@sfosterdiscovery sfosterdiscovery added the bug Something isn't working label Nov 28, 2023
@Anjanas-dh
Copy link

I have the same issue

@dgonzalezr
Copy link

dgonzalezr commented Jan 3, 2024

I can confirm the issue. I've got the same in a brand new Nx workspace with the latest Nx v17.2.8.

CleanShot 2024-01-03 at 16 53 49@2x

@sefasaid
Copy link

I have same issue. Any update regarding this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants