Skip to content

Commit 188e7db

Browse files
johnjenkinsJohn Jenkins
andauthored
fix(runtime): do not remove first comment - can break frameworks (#6343)
* fix(runtime): do not remove first comment - can break frameworks * chore: prettier --------- Co-authored-by: John Jenkins <[email protected]>
1 parent 051522f commit 188e7db

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/runtime/connected-callback.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@ export const connectedCallback = (elm: d.HostElement) => {
6161
cmpMeta.$flags$ & (CMP_FLAGS.hasSlotRelocation | CMP_FLAGS.needsShadowDomShim))
6262
) {
6363
setContentReference(elm);
64-
} else if (BUILD.hydrateClientSide && !(cmpMeta.$flags$ & CMP_FLAGS.hasSlotRelocation)) {
65-
const commendPlaceholder = elm.firstChild as d.RenderNode;
66-
if (
67-
commendPlaceholder?.nodeType === NODE_TYPE.CommentNode &&
68-
!commendPlaceholder['s-cn'] &&
69-
!commendPlaceholder.nodeValue
70-
) {
71-
// if the first child is a comment node that was created by the
72-
// setContentReference() function during SSR, remove it now as
73-
// this component does not need slot relocation and can cause hydration issues
74-
elm.removeChild(commendPlaceholder);
75-
}
7664
}
7765
}
7866

0 commit comments

Comments
 (0)