fix(core): skip component ID collision warning during SSR by crisbeto · Pull Request #59625 · angular/angular · GitHub
Skip to content

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

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

crisbeto wants to merge 1 commit into
angular:mainfrom
crisbeto:ssr-warning

Conversation

@crisbeto

@crisbeto crisbeto commented Jan 20, 2025 •

Copy link
Copy Markdown
Member

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
Comment thread packages/core/src/render3/definition.ts Outdated
Comment thread packages/core/src/render3/definition.ts Outdated
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.

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Contributor

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

ishbir commented Jan 20, 2025

Copy link
Copy Markdown

@alan-agius4

Copy link
Copy Markdown
Contributor

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

@ishbir

ishbir commented Jan 20, 2025

Copy link
Copy Markdown

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

@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