Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shjyh opened this issue Nov 23, 2016 · 2 comments
Closed

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

shjyh opened this issue Nov 23, 2016 · 2 comments

Comments

@shjyh
Copy link

shjyh commented Nov 23, 2016

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

@defcc defcc added the 2.0 label Nov 23, 2016
@defcc
Copy link
Member

defcc commented Nov 23, 2016

Seems to be the same problem with #4291, I am looking into it.

blake-newman added a commit to blake-newman/vue that referenced this issue Nov 23, 2016
- Check depth is 0 when checking special tag in SFC
- Moved depth decrement on SFC parser to make it's use clearer
- Updated tests to ensure regression is covered
@yyx990803
Copy link
Member

Out in 2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants