You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
logMismatchError() called redundantly in loop when SSR has excess child nodes #14855
Find the while loop inside hydrateElement at line 431
Observe that isMismatchAllowed() and logMismatchError() are both
called on every iteration of the loop, once per excess DOM node
Compare with the isMismatchAllowed() or logMismatchError() pattern used
elsewhere in the same file like hydrateChildren at line 608 where
the same redundancy exists
What is expected?
isMismatchAllowed() and logMismatchError() should each be called once per mismatch event, regardless of how many excess nodes need to be removed.
What is actually happening?
Both are called N times where N is the number of excess DOM nodes. The console.error only appears once due to the hasLoggedMismatchError guard inside logMismatchError(), but the calls themselves are redundant. The fix is to hoist the check outside the loop:
Activity
fix(runtime-core): avoid repeated hydration mismatch checks (vuejs#14857