Skip to content

fix(core): skip component ID collision warning during SSR#59625

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:ssr-warning
Closed

fix(core): skip component ID collision warning during SSR#59625
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:ssr-warning

Conversation

@crisbeto
Copy link
Copy Markdown
Member

@crisbeto crisbeto commented Jan 20, 2025

The component ID collision check tries to account for components being replaced by checking for the type, however that might not work during SSR.

These changes disable the warning since it's primarily useful on the browser anyways.

Closes angular/angular-cli#29408

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jan 20, 2025
@crisbeto crisbeto requested a review from alan-agius4 January 20, 2025 11:33
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jan 20, 2025
@ngbot ngbot bot added this to the Backlog milestone Jan 20, 2025
The component ID collision check tries to account for components being replaced by checking for the `type`, however that might not work during SSR.

These changes disable the warning since it's primarily useful on the browser anyways.
Copy link
Copy Markdown
Contributor

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker action: global presubmit The PR is in need of a google3 global presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: global presubmit The PR is in need of a google3 global presubmit labels Jan 20, 2025
@ishbir
Copy link
Copy Markdown

ishbir commented Jan 20, 2025

Thanks for fixing this warning. I'd just like to add that from what I've seen with my code, it's not just an inconvenience. It seems to also break the functionality in the browser, and then I have to re-run ng serve to get the behavior. I am unfortunately not familiar enough with Angular to know whether it's due to this issue or another one, but I started seeing it occur with this warning.

@alan-agius4
Copy link
Copy Markdown
Contributor

@ishbir, the IDs are mainly used for style encapsulation and hydration.

@ishbir
Copy link
Copy Markdown

ishbir commented Jan 20, 2025

Is it possible that hydration is breaking somehow due to this? I do see breaks in actions performed in afterNextRender in the constructor which would suggest that the elements in the view do not get found/hydrated at the right time. I could try to create a minimally reproducible example if that would help.

@alan-agius4
Copy link
Copy Markdown
Contributor

@ishbir, typically if there are hydration errors these are pointed out in the browser console. Please file an issue with a minimal reproduction.

@AndrewKushnir
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 431166d.

The changes were merged into the following branches: main, 19.1.x

AndrewKushnir pushed a commit that referenced this pull request Jan 21, 2025
The component ID collision check tries to account for components being replaced by checking for the `type`, however that might not work during SSR.

These changes disable the warning since it's primarily useful on the browser anyways.

PR Close #59625
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
)

The component ID collision check tries to account for components being replaced by checking for the `type`, however that might not work during SSR.

These changes disable the warning since it's primarily useful on the browser anyways.

PR Close angular#59625
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Feb 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

19.1.X NG0912: Incorrect Component ID collision warning

5 participants