Skip to content

Commit bb68456

Browse files
authored
fix: Wrap hydration debug message vars in quotes (#4609)
1 parent 2b82799 commit bb68456

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

debug/src/debug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,6 @@ options._hydrationMismatch = (newVNode, excessDomChildren) => {
589589
.map(child => child && child.localName)
590590
.filter(Boolean);
591591
console.error(
592-
`Expected a DOM node of type ${type} but found ${availableTypes.join(', ')} as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n${getOwnerStack(newVNode)}`
592+
`Expected a DOM node of type "${type}" but found "${availableTypes.join(', ')}" as available DOM-node(s), this is caused by the SSR'd HTML containing different DOM-nodes compared to the hydrated one.\n\n${getOwnerStack(newVNode)}`
593593
);
594594
};

debug/test/browser/debug.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ describe('debug', () => {
889889
hydrate(<App />, scratch);
890890
expect(console.error).to.be.calledOnce;
891891
expect(console.error).to.be.calledOnceWith(
892-
sinon.match(/Expected a DOM node of type p but found span/)
892+
sinon.match(/Expected a DOM node of type "p" but found "span"/)
893893
);
894894
});
895895

0 commit comments

Comments
 (0)