diff --git a/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/RenderTag.ts b/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/RenderTag.ts index ee6efeda8..ccc286988 100644 --- a/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/RenderTag.ts +++ b/packages/svelte2tsx/src/htmlxtojsx_v2/nodes/RenderTag.ts @@ -9,12 +9,12 @@ export function handleRenderTag(str: MagicString, renderTag: BaseNode): void { str.overwrite(renderTag.start, renderTag.expression.start, ';__sveltets_2_ensureSnippet(', { contentOnly: true }); - if (renderTag.argument) { - str.overwrite( - withTrailingPropertyAccess(str.original, renderTag.argument.end), - renderTag.end, - '));' - ); + + // argument was present until https://github.com/sveltejs/svelte/pull/9988, remove at some point + const arg = renderTag.argument || renderTag.arguments?.[renderTag.arguments.length - 1]; + + if (arg) { + str.overwrite(withTrailingPropertyAccess(str.original, arg.end), renderTag.end, '));'); } else { str.overwrite( withTrailingPropertyAccess(str.original, renderTag.expression.end),