Skip to content

Commit 562623d

Browse files
fix: use SSR format compatible with nginx SSI for props.id (#16820)
* fix: use SSR format compatible with nginx SSI for props.id * changeset --------- Co-authored-by: Rich Harris <[email protected]>
1 parent cf35a22 commit 562623d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/silly-schools-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: use nginx SSI-compatible comments for `$props.id()`

packages/svelte/src/internal/client/dom/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ export function props_id() {
365365
hydrating &&
366366
hydrate_node &&
367367
hydrate_node.nodeType === COMMENT_NODE &&
368-
hydrate_node.textContent?.startsWith(`#`)
368+
hydrate_node.textContent?.startsWith(`$`)
369369
) {
370370
const id = hydrate_node.textContent.substring(1);
371371
hydrate_next();

packages/svelte/src/internal/server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ export function once(get_value) {
448448
*/
449449
export function props_id(renderer) {
450450
const uid = renderer.global.uid();
451-
renderer.push('<!--#' + uid + '-->');
451+
renderer.push('<!--$' + uid + '-->');
452452
return uid;
453453
}
454454

0 commit comments

Comments
 (0)