Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve error message when multiple components use same selector #7067

Closed
0x-r4bbit opened this issue Feb 14, 2016 · 10 comments
Closed
Labels
help wanted An issue that is suitable for a community contributor (based on its complexity/scope). hotlist: error messages

Comments

@0x-r4bbit
Copy link
Contributor

I accidently ran into this due to copy and pasting. Forgot to change the selector of the copied component, here's the error I got:

EXCEPTION: Template parse errors:
More than one component: ComponentEight,ComponentNine ("

    <ul>
      <li>[ERROR ->]<cmp-eight></cmp-eight></li>
      <li><cmp-nine></cmp-nine></li>
    </ul>
"): ComponentFour@4:10

While this actually already gives enough information, I think we can do better with the "More than one component" message. Maybe we can make it sth. like "The following components have the same selector: Cmp1, Cmp2" ?

/cc @vsavkin

@kinggolf
Copy link

kinggolf commented Jun 4, 2016

Thanks Pascal. I did the same exact thing just today and could not figure out what was going on, until I read your suggestion.

@SnareChops
Copy link

+1 here. Just bumped into this myself. Thanks Pascal for saving me probably a few hours of headache and searching.

@vicb
Copy link
Contributor

vicb commented Jun 21, 2016

note: It could be the same or intersecting selector. PR welcome, it should be an easy one

@vicb vicb added the help wanted An issue that is suitable for a community contributor (based on its complexity/scope). label Jun 21, 2016
@wethinkagile
Copy link

wethinkagile commented Jul 29, 2016

There are no txt files in Angular project, usually, Vercaelus.

@jkyoutsey
Copy link

jkyoutsey commented Aug 11, 2016

Honestly, this message means nothing to me. I'm getting it now and it does nothing to help me know what is the source of the problem, or how to fix it.

"Template parse errors:↵More than one component: CellAuthoringComponent,CellComponent ("ernalProperties.columns}}" sio2Dropzone (dropped)="onDropped($event)" [accepts]="acceptCheck">
↵    [ERROR ->]<sio2-cell *ngFor="let colNum of (properties.columns | sio2Range)" [columnsSplit]="properties.columns"): LayoutAuthoringComponent@1:4↵More than one component: CellAuthoringComponent,CellComponent (" colNum of (properties.columns | sio2Range)" [columnsSplit]="properties.columns" ></sio2-cell>
↵    [ERROR ->]<sio2-cell *ngFor="let child of children"></sio2-cell>
↵</div>
↵"): LayoutAuthoringComponent@2:4"

What it should say is that two or more components have the same selector.

@vicb
Copy link
Contributor

vicb commented Aug 12, 2016

@jkyoutsey it says that you have "More than one component: CellAuthoringComponent,CellComponent" (that's 2) at "ERROR ->]<sio2-cell>..."

I guess those 2 components use selector: 'sio2-cell' which would be an obvious error.

If you need more help please use the support channels (gitter, SO)

edit:

  • Given the last line of your comment you probably figured out by yourself,
  • Now think what happen when the component would use tag and [attribute] as selectors. You would have the same issue but the selectors are not the "same".

pkozlowski-opensource added a commit to pkozlowski-opensource/angular that referenced this issue Aug 31, 2016
pkozlowski-opensource added a commit to pkozlowski-opensource/angular that referenced this issue Aug 31, 2016
pkozlowski-opensource added a commit to pkozlowski-opensource/angular that referenced this issue Aug 31, 2016
pkozlowski-opensource added a commit to pkozlowski-opensource/angular that referenced this issue Aug 31, 2016
voithos added a commit to voithos/angular that referenced this issue Oct 29, 2016
@stchoukeu
Copy link

Good Morning to everyone,
Please i need your help. I'm facing this problem witch seem to be similar to the one you describe here. i'm not able to solve it. This is an Error message that i receive during the build process.
Error: Template parse errors More than one component: Button Item (" ngc failed ionic-app-script task: "build" Error: Error

@zoechi
Copy link
Contributor

zoechi commented Nov 27, 2016

@stchoukeu
Copy link

stchoukeu commented Nov 27, 2016 via email

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted An issue that is suitable for a community contributor (based on its complexity/scope). hotlist: error messages
Projects
None yet
9 participants