Template section not output in vue files

mickdekkers
0
mickdekkers
commented a year ago

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

0
qm3ster
383
qm3ster
commented a year ago

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.

0
mickdekkers
0
mickdekkers
commented a year ago

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>
0
qm3ster
383
qm3ster
commented a year ago

I updated from 8.4.0 to 8.7.0 and still don't have the problem.
I am on Ubuntu GNOME 17.04 though.

0
qm3ster
383
qm3ster
commented a year ago

@mickdekkers please sign off here if you resolve the issue or have any new information.

0
mickdekkers
0
mickdekkers
commented a year ago

Alright, I'll let you know if I discover anything new.

0
vuchl
150
vuchl
commented a year ago

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:
carbon

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:
image

I also updated npm againt to 5.5.1 but i can not replicate your issue

1
vuchl
150
vuchl
commented a year ago

@mickdekkers did you make any discoveries? Or can I close the issue?

0
mickdekkers
0
mickdekkers
commented a year ago

@vuchl I'm afraid I haven't. As a workaround I just copied the missing code from the repo directly. Feel free to close ๐Ÿ™‚

0
Informations
Question โ€ข Unresolved
#c4 - Created a year ago