diff --git a/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/SnippetBlock.ts b/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/SnippetBlock.ts
index 4c0873f68..6facaffba 100644
--- a/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/SnippetBlock.ts
+++ b/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/SnippetBlock.ts
@@ -47,7 +47,7 @@ export function handleSnippet(
const startEnd =
str.original.indexOf(
'}',
- lastParameter?.typeAnnotation.end ?? lastParameter?.end ?? snippetBlock.expression.end
+ lastParameter?.typeAnnotation?.end ?? lastParameter?.end ?? snippetBlock.expression.end
) + 1;
if (isImplicitProp) {