diff --git a/src/compile/render-dom/wrappers/shared/create_debugging_comment.ts b/src/compile/render-dom/wrappers/shared/create_debugging_comment.ts index 55d7b307d3..b32d25c1a4 100644 --- a/src/compile/render-dom/wrappers/shared/create_debugging_comment.ts +++ b/src/compile/render-dom/wrappers/shared/create_debugging_comment.ts @@ -16,7 +16,7 @@ export default function create_debugging_comment( let d; if (node.type === 'InlineComponent' || node.type === 'Element') { - d = node.children[0].start; + d = node.children.length ? node.children[0].start : node.start; while (source[d - 1] !== '>') d -= 1; } else { d = node.expression ? node.expression.node.end : c; diff --git a/test/runtime/samples/component-slot-empty-b/Nested.svelte b/test/runtime/samples/component-slot-empty-b/Nested.svelte new file mode 100644 index 0000000000..008d9e2fbb --- /dev/null +++ b/test/runtime/samples/component-slot-empty-b/Nested.svelte @@ -0,0 +1,3 @@ +