When I used the template, for some reason the vue files it created did not have <template>
sections.
Looking at the source, it seems to use some kind of {{{{raw}}}}
helper, presumably the one in meta.json
.
If I had to guess, I'd say that function is returning undefined or perhaps an empty string.
Using vue-cli v2.9.1
Oh sorry I forgot to mention, my node version is 8.7.0 and I'm on Windows 10 64-bit.
It happened for all the vue files that use the helper.
As far as I can tell (through yarn global list
and npm ls -g --depth 0
) I don't have handlebars installed globally.
I ran the command you posted and I'm not seeing a template section, so at least it's reproducible.
vue-cli · Generated "test".
To get started:
cd test
npm install # Or yarn
npm run dev # Or yarn dev
<script>
import axios from '~/plugins/axios'
export default {
data () {
return {
users: []
}
},
async asyncData () {
const {data} = await axios.get('/api/users')
return {users: data}
},
head () {
return {
title: 'Users'
}
}
}
</script>
<style scoped>
.title
{
margin: 30px 0;
}
.users
{
list-style: none;
margin: 0;
padding: 0;
}
.user
{
margin: 10px 0;
}
</style>
I'll take a look tomorrow. But it's definately coming from vue-cli
and the templating system. we had a similar issue before here #4
First edit:
$ node -v
8.7.0
$ npm -v
5.4.2
$ npm i -g npm
...
+ [email protected]5.5.1
$ npm i -g vue-cli
$ vue -V
2.9.1
$ vue init nuxt-community/nuxt-micro-template numi
The ouput:
Second edit:
C:\Users\sebastian>node -v
8.7.0
C:\Users\sebastian>npm -v
5.4.2
C:\Users\sebastian>vue -V
2.9.1
C:\Users\sebastian>vue init nuxt-community/nuxt-micro-template numi
The index,vue:
I also updated npm againt to 5.5.1 but i can not replicate your issue
@vuchl I'm afraid I haven't. As a workaround I just copied the missing code from the repo directly. Feel free to close 🙂
Maybe you have a version of handlebars installed globally that is older than custom helpers?
I just tried it.
vue --version #> 2.9.1
vue init nuxt-community/micro-template test && cd test && cat pages/index.vue
produces the desired output, including the template with uninterpolated vue
{{}}
.Was it all of the
.vue
files or just some?What node version?
The same function is used in the express template.