From 4137491fd0ddff74d7ff697e0c4afb7c1c3cc784 Mon Sep 17 00:00:00 2001 From: paoloricciuti Date: Thu, 11 Jul 2024 00:09:48 +0200 Subject: [PATCH] fix: limit the length of the client value shown in the error --- packages/svelte/src/internal/client/dom/blocks/html.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/svelte/src/internal/client/dom/blocks/html.js b/packages/svelte/src/internal/client/dom/blocks/html.js index b31c3bf834..a0255c22e6 100644 --- a/packages/svelte/src/internal/client/dom/blocks/html.js +++ b/packages/svelte/src/internal/client/dom/blocks/html.js @@ -16,7 +16,8 @@ function check_hash_in_dev_hydration(server_hash, value) { if (!DEV) return; if (!server_hash || server_hash === hash(value)) return; - w.hydration_html_changed(String(value)); + // limit the length of the value shown in the error as this might get lengthy + w.hydration_html_changed(`${value.slice(0, 25)}${value.length > 25 ? '...' : ''}`); } /**