Skip to content

Commit

Permalink
fix: Wrap hydration debug message vars in quotes (#4609)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian authored Dec 15, 2024
1 parent 2b82799 commit bb68456
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debug/src/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,6 @@ options._hydrationMismatch = (newVNode, excessDomChildren) => {
.map(child => child && child.localName)
.filter(Boolean);
console.error(
`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)}`
`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)}`
);
};
2 changes: 1 addition & 1 deletion debug/test/browser/debug.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ describe('debug', () => {
hydrate(<App />, scratch);
expect(console.error).to.be.calledOnce;
expect(console.error).to.be.calledOnceWith(
sinon.match(/Expected a DOM node of type p but found span/)
sinon.match(/Expected a DOM node of type "p" but found "span"/)
);
});

Expand Down

0 comments on commit bb68456

Please sign in to comment.