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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in SSR when using a package with Angular Package Format #16127

Closed
dxvladislavvolkov opened this issue Oct 29, 2019 · 3 comments

Comments

@dxvladislavvolkov
Copy link

@dxvladislavvolkov dxvladislavvolkov commented Oct 29, 2019

馃悶 bug report

Affected Package

Is this a regression?

Description

I created and built my lib using ng-packagr.

When I import module from my lib in universal app I get an error when trying build application
This happens when I add an Input in my component, like this

@Input()
    get accessKey(): string {
        return this._getOption('accessKey');
    }
    set accessKey(value: string) {
        this._setOption('accessKey', value);
    }

馃敩 Minimal Reproduction

You can reproduce it using the repo
Following the steps:

npm i
npm run build:ssr
and then you get the error

馃敟 Exception or Error




ERROR in ./node_modules/super-toasty/fesm5/super-toasty.js
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'kind' of undefined
    at isAngularDecoratorMetadataExpression (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:265:35)
    at checkNodeForDecorators (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:77:21)
    at visitNodes (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16514:30)
    at Object.forEachChild (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16740:24)
    at checkNodeForDecorators (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16635:21)
    at checkNodeForDecorators (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16692:24)
    at checkNodeForDecorators (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16703:24)
    at checkNodeForDecorators (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31)
    at visitNode (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16505:24)
    at Object.forEachChild (C:\Users\volkov.vladislav\Downloads\downloadnew\universal\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16599:21)

馃實 Your Environment

Angular Version:




8.2.9

Anything else relevant?

@dxvladislavvolkov

This comment has been minimized.

Copy link
Author

@dxvladislavvolkov dxvladislavvolkov commented Oct 30, 2019

The same issue happens if you import MatButtonToggleGroup from @angular/material/button-toggle.

@IgorMinar

This comment has been minimized.

Copy link
Member

@IgorMinar IgorMinar commented Nov 9, 2019

This is not a framework or compiler issue, but rather a cli isssue.

can you update to the latest version of @angular/cli v8 and try again?

I'm going to transfer the issue to the cli repo.

@IgorMinar IgorMinar transferred this issue from angular/angular Nov 9, 2019
@clydin

This comment has been minimized.

Copy link
Member

@clydin clydin commented Nov 9, 2019

This appears to be a duplicate of #15703 which was fixed in version 8.3.7 of the CLI.

@alan-agius4 alan-agius4 closed this Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can鈥檛 perform that action at this time.