From bb6845682c04692a09d3265deb59b158e7f43efb Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:34:41 -0600 Subject: [PATCH] fix: Wrap hydration debug message vars in quotes (#4609) --- debug/src/debug.js | 2 +- debug/test/browser/debug.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debug/src/debug.js b/debug/src/debug.js index 30fdabb3e2..23d913646a 100644 --- a/debug/src/debug.js +++ b/debug/src/debug.js @@ -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)}` ); }; diff --git a/debug/test/browser/debug.test.js b/debug/test/browser/debug.test.js index eda8e77534..aefb894281 100644 --- a/debug/test/browser/debug.test.js +++ b/debug/test/browser/debug.test.js @@ -889,7 +889,7 @@ describe('debug', () => { hydrate(, 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"/) ); });