OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Why Angular generates two components in the target javascript file?

  • Thread starter Thread starter Ondrej Peterka
  • Start date Start date
O

Ondrej Peterka

Guest
I was investigating problem described here: https://github.com/angular/angular/issues/53592 as I have run into this for our 5 components. I have noticed (when debugging the angular core code) that the types compared to raise the warning are different and reference different constructors:

enter image description here

The constructors looks like this (notice the extends part and different line numbers): enter image description here enter image description here

Additional info:

  • we are using ang 17 (just in the process of upgrade) and material 16
  • in code the problematic components are exported only once
  • all problematic components are 'dialog' ones, so being used by DialogService from the same module/ entry point
  • other (non-problematic) components seem to be in the javascript only once (search for class XXXComponent)

Why Angular generates two components in the target javascript file? What needs to be done, so there is only one occurrence generated?

<p>I was investigating problem described here: <a href="https://github.com/angular/angular/issues/53592" rel="nofollow noreferrer">https://github.com/angular/angular/issues/53592</a> as I have run into this for our 5 components. I have noticed (when debugging the angular core code) that the types compared to raise the warning are different and reference different constructors:</p>
<p><a href="https://i.sstatic.net/ICRj4uWk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ICRj4uWk.png" alt="enter image description here" /></a></p>
<p>The constructors looks like this (notice the extends part and different line numbers):
<a href="https://i.sstatic.net/1QdQNR3L.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/1QdQNR3L.png" alt="enter image description here" /></a>
<a href="https://i.sstatic.net/kZHpCL9b.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kZHpCL9b.png" alt="enter image description here" /></a></p>
<p>Additional info:</p>
<ul>
<li>we are using ang 17 (just in the process of upgrade) and material 16</li>
<li>in code the problematic components are exported only once</li>
<li>all problematic components are 'dialog' ones, so being used by DialogService from the same module/ entry point</li>
<li>other (non-problematic) components seem to be in the javascript only once (search for class XXXComponent)</li>
</ul>
<p>Why Angular generates two components in the target javascript file?
What needs to be done, so there is only one occurrence generated?</p>
 

Latest posts

A
Replies
0
Views
1
Amar Kalabić
A
Top