fix invalid HTML message

pull/12335/head
Rich Harris 2 years ago
parent 79755e3c71
commit 2486b953d8

@ -38,7 +38,7 @@ function stringify(element) {
*/
function print_error(payload, parent, child) {
var message =
`${stringify(child)} cannot contain ${stringify(parent)}\n\n` +
`${stringify(parent)} cannot contain ${stringify(child)}\n\n` +
'This can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.';
if ((seen ??= new Set()).has(message)) return;

@ -32,7 +32,7 @@ export default test({
if (variant === 'hydrate') {
assert.equal(
log[0],
'`<h1>` (Component.svelte:1:0) cannot contain `<p>` (main.svelte:5:0)\n\n' +
'`<p>` (main.svelte:5:0) cannot contain `<h1>` (Component.svelte:1:0)\n\n' +
'This can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.'
);
}

Loading…
Cancel
Save