stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.31k stars 918 forks source link

Angular Ivy: Kendo UI packages fail to compile #1229

Open tsvetomir opened 4 years ago

tsvetomir commented 4 years ago

Getting the following error when attempting to add the Kendo UI Grid to an Ivy project on StackBlitz, see sample:

ngcc failed to run on @progress/kendo-angular-dateinputs@4.2.2, @progress/kendo-angular-grid@4.7.1.

The packages work fine with Ivy in a regular CLI project. Any idea what might be wrong?

EricSimons commented 4 years ago

@tsvetomir thanks for letting us know about this- having folks on our side investigate now 👍

rezonant commented 4 years ago

This is happening for one of my own Angular libraries -- is there any way we can get more info than just "ngcc failed to run"? The same library seems to work fine in a local Angular CLI app...

Some digging in the Chrome Inspector leads me to this request (this library isn't mine but it also fails to load in StackBlitz): GET https://l.staticblitz.com/ngcc/v3/9.1.9/ngx-monaco-editor@9.0.0 -> 500 with body "Internal Server Error"

EricSimons commented 4 years ago

Yeah, the issue is that ngcc fails out on our serverless endpoint, but this can happen for a variety of reasons (package too big, peerDependencies missing, etc). @rezonant can you link your package here as well so I can test it out?

rezonant commented 4 years ago

Absolutely, my Angular component library is diazo on NPM, and here is a Stackblitz with Diazo, ngx-monaco-editor and the other peer deps loaded in that causes the issue: https://stackblitz.com/edit/angular-ivy-vvwp1d

EDIT: While waiting to hear back it occurs to me the "package too big" is a pretty compelling reason- diazo is currently 3.11MB on NPM, ngx-monaco-editor is some 10MB and @progress/kendo-angular-grid (which fails in the OP) is 7.22MB. The other Kendo UI dependencies in the example Stackblitz seem to be much smaller. Counterpoint, @angular/material is 29MB unpacked, but wouldn't be surprised if this is special-cased. Looking forward to hearing what you're able to learn!

eestein commented 4 years ago

I've got the same problem with my lib. It's working nicely and being verified by ngcc locally. Two production apps on angular v9 are using it without any issues, but it breaks on StackBlitz.

I even created an issue on ngcc validation repo https://github.com/angular/ngcc-validation/issues/1384 and they confirmed my lib is properly set. Any news regarding this issue?

Thanks.

ocombe commented 4 years ago

Same issue with my library Locl: https://l.staticblitz.com/ngcc/v3/10.0.5/@locl/core@1.0.0 :-/ Any chance to get the complete log @EricSimons please?

edit: turns out it was a peer dependency that was wrong in my lib, I updated the code and it works now!

rezonant commented 4 years ago

@ocombe Can you give some more detail? My lib still fails, if I can get that one working maybe I can PR for ngx-monaco-editor as well

ocombe commented 4 years ago

I had a peer dependency for @angular/core ^9.0.0 and I was trying to use it in stackblitz with v10.0.5, I changed the peer dependency of the lib to ^10.0.0 and it works in stackblitz with v10.0.5 now

rezonant commented 4 years ago

I see, will have to explore that. While I was waiting for a response I snooped your lib and your commit to fix in case it's helpful for anyone else, it's https://github.com/loclapp/locl/commit/71001b1321841738cecfeafee304f1fb4e686e87

tsvetomir commented 4 years ago

Currently ngcc seems to pass successfully for some of the smaller packages. The test application fails to run with a different error:

Import error, can't find files:
./main
vthinkxie commented 4 years ago

meet the same problem when enabling ivy in ng-zorro-antd https://stackblitz.com/edit/ng-zorro-antd-ivy?file=src%2Fmain.ts