Nebular: Nebular/theme v6.0.0 error during ngcc post-install

Created on 3 Aug 2020  路  6Comments  路  Source: akveo/nebular

Issue type

I'm submitting a ... (check one with "x")

  • [ x ] bug report
  • [ ] feature request

Issue description

Current behavior:
After upgrading to Angular 10.0.7 and Nebular 6.0.0, the angular compiler check ngcc post-install fails with the following error:

Compiling @nebular/theme : main as umd
Error: Error on worker #1: Error: Attempted to get members of a non-class: "class NbActiveDescendantKeyManagerFactoryService {
create(items) {
return new NbActiveDescendantKeyManager(items);
}
}"

Expected behavior:
Nebular 6 should make it through the ngcc without failing.

Steps to reproduce:
Update to Angular 10.0.7, then update to Nebular 6. If ngcc is run as a post-install script it will fail on @nebular/theme

Related code:

Other information:

npm, node, OS, Browser
Node, npm: node v12.16.1 / npm v6.13.4
macOS v10.15.6

Angular, Nebular
"@angular/animations": "^10.0.7",
"@angular/cdk": "^10.1.1",
"@angular/common": "^10.0.7",
"@angular/compiler": "^10.0.7",
"@angular/core": "^10.0.7",
"@angular/forms": "^10.0.7",
"@angular/localize": "^10.0.7",
"@angular/material": "^10.1.1",
"@angular/platform-browser": "^10.0.7",
"@angular/platform-browser-dynamic": "^10.0.7",
"@angular/router": "^10.0.7",
"@angular/service-worker": "^10.0.7",

"@nebular/auth": "^6.0.0",
"@nebular/bootstrap": "^6.0.0",
"@nebular/eva-icons": "^6.0.0",
"@nebular/moment": "^6.0.0",
"@nebular/security": "^6.0.0",
"@nebular/theme": "^6.0.0",

Most helpful comment

Version 6.2.0 with the fix is available on npm.

All 6 comments

Also experiencing this issue. Did you find a fix?

Also experiencing this issue. Did you find a fix?

Haven't been able to find a fix, was forced to take our app back to Nebular v5.1.0.

Also experiencing this issue.

This is caused by the fact that the UMD bundles of the @nebular/* packages contain ES2015 code (for example, classes).
We also ran into this with v6.0.0 and v6.0.1 on our ngcc validation repo: angular/ngcc-validation#1654

#

For people facing this, if you are not using the UMD bundles, you can avoid processing the main property of package.json (which points to the UMD bundles) with ngcc. By default, ngcc tries to process all available properties, but you can specify the ones you need via the --properties option. (Run node_modules/.bin/ngcc --help for more info.)

Also, in most cases you should not need to run ngcc explicitly (if you are using the Angular CLI). The Angular CLI will take care of calling ngcc as needed (and with the appropriate arguments).

_Update: This is still broken in v6.1.0._

Version 6.2.0 with the fix is available on npm.

Was this page helpful?
0 / 5 - 0 ratings