Skip to content

Cannot build AOT - 'Illegal state: Could not load the summary for directive CdkTrapFocus' [Library] #10615

Closed
@Tyler-V

Description

@Tyler-V

Versions

@angular-devkit/architect          0.5.8
@angular-devkit/build-angular      0.5.13
@angular-devkit/build-ng-packagr   0.5.13
@angular-devkit/build-optimizer    0.5.13
@angular-devkit/core               0.5.8
@angular-devkit/schematics         0.5.8
@angular/cdk                       5.2.5
@angular/cli                       6.0.0-rc.6
@angular/material                  5.2.5
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.0-rc.11
@schematics/angular                0.5.8
@schematics/update                 0.5.8
ng-packagr                         2.4.2
rxjs                               6.0.0
typescript                         2.7.2
webpack                            4.6.0

Repro steps

ng build --prod

Observed behavior

PS C:\Users\Tyler\Documents\GitHub\@ngx-easy> ng build --prod

Date: 2018-05-03T20:42:34.690Z
Hash: 8211a34b9047475b0c8e
Time: 10706ms
chunk {0} runtime.6afe30102d8fe7337431.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.dbf5cc60be95fada7422.css (styles) 43.6 kB [initial] [rendered]
chunk {2} polyfills.7b179b8b06c2bb8cdc21.js (polyfills) 130 bytes [initial] [rendered]
chunk {3} main.aad69072215eb1da4e1b.js (main) 128 bytes [initial] [rendered]

ERROR in : Illegal state: Could not load the summary for directive CdkTrapFocus in C:/Users/Tyler/Documents/GitHub/@ngx-easy/projects/easy-grid/node_modules/@angular/cdk/a11y/typings/index.d.ts.

Building Angular Package
Building entry point '@ngx-easy/virtual-scroll'
Cleaning build directory
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc
Bundling to FESM15
Bundling to FESM5
Bundling to UMD
Minifying UMD bundle
Relocating source maps
Copying staged files
Writing package metadata
Removing scripts section in package.json as it's considered a potential security vulnerability.
Creating package .tgz
Built @ngx-easy/virtual-scroll
Built Angular Package!
- from: C:\Users\Tyler\Documents\GitHub\@ngx-easy\projects\easy-virtual-scroll
- to:   C:\Users\Tyler\Documents\GitHub\@ngx-easy\dist\easy-virtual-scroll
Building Angular Package
Building entry point '@ngx-easy/grid'
Cleaning build directory
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc
Bundling to FESM15
'QueryList' is imported from external module '@angular/core' but never used
'EasyVirtualScrollComponent' is imported from external module '@ngx-easy/virtual-scroll' but never used
'MatMenu' is imported from external module '@angular/material/menu' but never used
Bundling to FESM5
Bundling to UMD
No name was provided for external module 'rxjs' in options.globals – guessing 'rxjs'
No name was provided for external module 'lodash' in options.globals – guessing 'lodash'
No name was provided for external module '@ngx-easy/virtual-scroll' in options.globals – guessing 'virtualScroll'
Minifying UMD bundle
Dropping unreachable code [0:158,8]
Declarations in unreachable code! [0:158,8]
Dropping unreachable code [0:26,0]
Declarations in unreachable code! [0:26,0]
Relocating source maps
Copying staged files
Writing package metadata
Removing scripts section in package.json as it's considered a potential security vulnerability.
Creating package .tgz
Built @ngx-easy/grid
Built Angular Package!
- from: C:\Users\Tyler\Documents\GitHub\@ngx-easy\projects\easy-grid
- to:   C:\Users\Tyler\Documents\GitHub\@ngx-easy\dist\easy-grid
PS C:\Users\Tyler\Documents\GitHub\@ngx-easy>

Desired behavior

Successfully build app and projects libraries

Mention any other details that might be useful (optional)

I am using the latest cli and trying to build a library with the ng generate library command.

I'm able to serve and build the projects without issue (minus ng-packagr/ng-packagr#822)

I have my demo app for displaying these libraries in the app.component of my project where I have generated two libraries, the demo app will not build with the --prod flag however.

I believe this is a .tsconfig issue based on the comments received in opening angular/components#11124

I am opening this issue here as well because I believe there is something maybe missing from the default project settings or to see if anyone else might have an idea on how to fix this.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions