vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.99k stars 915 forks source link

  in Pug is causing TypeError: Cannot read property 'text' of undefined #597

Closed f0rmiga closed 7 years ago

f0rmiga commented 7 years ago

I am using   to emphasize spaces at the end of a line, for example:

a.blue(v-if="index != 0", @click="prev")  
    i.icon.angle.left.icon

It is causing this error:

ERROR in ./~/vue-loader/lib/template-compiler.js?id=data-v-3b169ecc!./~/vue-loader/lib/template-loader.js?raw&engine=pug!./~/vue-loader/lib/selector.js?type=template&index=0!./src/file_to_compile.vue
Module build failed: TypeError: Cannot read property 'text' of undefined
    at Object.chars (/path/to/app/node_modules/vue-template-compiler/build.js:1385:65)
    at parseHTML (/path/to/app/node_modules/vue-template-compiler/build.js:537:17)
    at parse (/path/to/app/node_modules/vue-template-compiler/build.js:1203:3)
    at compile$2 (/path/to/app/node_modules/vue-template-compiler/build.js:2283:13)
    at compile$1 (/path/to/app/node_modules/vue-template-compiler/build.js:5739:10)
    at Object.compile$$1 [as compile] (/path/to/app/node_modules/vue-template-compiler/build.js:5931:18)
    at Object.module.exports (/path/to/app/node_modules/vue-loader/lib/template-compiler.js:60:27)
 @ ./src/file_to_compile.vue 8:23-195
kazupon commented 7 years ago

Can you provide the reproduction repo please?

f0rmiga commented 7 years ago

https://github.com/f0rmiga/bug-space

I generated a simple template using vue-cli, added the pug package and added   to the App.vue file.

Note that  and ! does not give any error, but &#32 or   does.

kazupon commented 7 years ago

This is issue of vue core. This issue already fixed https://github.com/vuejs/vue/pull/4760 Close.