diff --git a/src/generators/dom/preprocess.js b/src/generators/dom/preprocess.js index 8661dbb0fb85..6e6c33eafffc 100644 --- a/src/generators/dom/preprocess.js +++ b/src/generators/dom/preprocess.js @@ -264,7 +264,7 @@ function preprocessChildren ( generator, block, state, node, isTopLevel ) { if ( lastChild ) { lastChild.next = child; - lastChild.needsAnchor = !child._state.name; + lastChild.needsAnchor = !child._state || !child._state.name; } lastChild = child; diff --git a/test/runtime/samples/component-yield-follows-element/Foo.html b/test/runtime/samples/component-yield-follows-element/Foo.html new file mode 100644 index 000000000000..1e619f2ecdb0 --- /dev/null +++ b/test/runtime/samples/component-yield-follows-element/Foo.html @@ -0,0 +1,2 @@ +