Skip to content

template-compiler throw error after I upgrade Vue@2.1.0 #4289

@shjyh

Description

@shjyh

template-compiler throw

template syntax error Component template should contain exactly one root element:

while use vue-loader in webpack@2.x after I upgrade vue@2.1.0 today.

here's my template in vue component:

<div class="j-title">
    <template v-if="status.isView">
        <div @pointerup="setEdit" class="title">{{journey.title}}</div>
        <div @pointerup="setEdit" v-if="author" class="author">{{author.name}}</div>
    </template>
    <template v-else>
        <textarea v-autosize placeholder="title here"  v-model="journey.title" rows="1"></textarea>
        <div class="author flex flex-center"><input class="flex-1"  placeholder="insert your name" v-model="author.name"></div>
    </template>
</div>

exactly the component only contain one root element and i really don't know what's wrong with it

Vue.js version

2.1.0

Demo

here's my simple demo
https://github.com/shjyh/vue_error_demo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions