Help with error in compiled files after update

20 views
Skip to first unread message

Herson Leite

unread,
Oct 11, 2017, 7:36:18 PM10/11/17
to Angular and AngularJS discussion
Hi,

I created a new angular package and after install dependencies yesterday, angular-compiler 4.4.4 and some another angular packages was installed and my compiled files are missing constructor parameters meta data. I tried to find where they are generated but I can't understand very well. 

Here is a example of generated code when I use angular 4.4.3 and ngc: https://gist.github.com/hersonls/0e8f87bd2366958c81aa7d7495b7ef5c
And here is a example after update and was installed angular 4.4.4: https://gist.github.com/hersonls/4b4a8ce57a98ab1a159f5e2c50814d08

The main diference is the missing LoadingComponent.ctorParameters, wich raise a error when the app is running, the error is the missing dependence injection. After some research I believe ctorParameters is generated Reflection by ( https://github.com/angular/angular/blob/d489ad595de1e128ec6f96d2383fef696c78217b/packages/core/src/reflection/reflection_capabilities.ts#L56)

Someone can help me understand how reflected is generated? Who is responsible to generate them, ngc, typescript or another thing?

Thank you

Sander Elias

unread,
Oct 12, 2017, 6:33:35 AM10/12/17
to Angular and AngularJS discussion

Hi Herson,

This kind of error is often being caused by a mismatch of versions. did you try deleting your node_modules, and yarn lockfile, and npm install or yarn after that?

Regards
Sander

Herson Leite

unread,
Oct 16, 2017, 4:26:39 PM10/16/17
to Angular and AngularJS discussion
Hi Sander,

Yes, but still same. I think is some change in some dependencies which I can't find. Seems tsc-wrapped in 4.4.4 version

I rollback and works fine, but I want understand this behavior, who is responsible to generate the code and that meta data.

Thanks again.

Sander Elias

unread,
Oct 17, 2017, 3:01:32 AM10/17/17
to Angular and AngularJS discussion
Hi Herson,

Well, the code is generated by ngc, if you want to dig into this, you can start there. I remember there where some changes around here but those shouldn't be an issue outside internals. Don't remember the details, but you might have hit upon a possible issue. I really can't tell without seeing the source.

Regards
Sander

Herson Leite

unread,
Oct 18, 2017, 3:45:16 PM10/18/17
to Angular and AngularJS discussion
Hi Sander, I found the problem!

After some research, the problem is with Yarn < 1.2.1 which had a bug with peer dependencies. I tried use NPM and works fine, and I tried delete yarn.lock and tried again and nothing.

I found a Issue in Yarn project and one guy found the problem which I mentioned above ( https://github.com/yarnpkg/yarn/issues/4499 ). So they fixed the problem in Yarn in version 1.2.1 about 6 days ago. I tried and works fine.

Thanks for the help!

Sander Elias

unread,
Oct 18, 2017, 11:19:30 PM10/18/17
to Angular and AngularJS discussion
Hi Herson,

So my first assumption on mismatched versions was correct ;) I'm a long-time yarn user, and found it very useful, but sometimes it messes up (BTW, the same kind of issues now pop up with the new npm lockfile!)
However, I never got such an issue that survived a `rm -fr node_modules yarn.lock`. I got other issues that needed me to update yarn though,

Regards
Sander
Reply all
Reply to author
Forward
0 new messages