Skip to content

pug failed to compile after update to vue 2.5.18 #9163

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

Closed
kuoruan opened this issue Dec 8, 2018 · 1 comment
Closed

pug failed to compile after update to vue 2.5.18 #9163

kuoruan opened this issue Dec 8, 2018 · 1 comment

Comments

@kuoruan
Copy link

kuoruan commented Dec 8, 2018

Version

2.5.18

Reproduction link

https://github.com/kuoruan/pug-vue

Steps to reproduce

  • npm install
  • npm run serve

What is expected?

run success.

What is actually happening?

 ERROR  Failed to compile with 1 errors                                                                                                                                         5:35:13 PM

 error  in ./src/App.vue?vue&type=template&id=7ba5bd90&lang=pug&

Module build failed (from ./node_modules/pug-plain-loader/index.js):
Error: /Users/liao/Projects/Vue/pug-vue/src/App.vue:2:1
    1|
  > 2|   #app
-------^
    3|     img(alt="Vue logo", src="./assets/logo.png")
    4|     HelloWorld(msg="Welcome to Your Vue.js App")
    5|

unexpected token "indent"
    at makeError (/Users/liao/Projects/Vue/pug-vue/node_modules/pug-error/index.js:32:13)
    at Parser.error (/Users/liao/Projects/Vue/pug-vue/node_modules/pug-parser/index.js:53:15)
    at Parser.parseExpr (/Users/liao/Projects/Vue/pug-vue/node_modules/pug-parser/index.js:264:14)
    at Parser.parse (/Users/liao/Projects/Vue/pug-vue/node_modules/pug-parser/index.js:112:25)
    at parse (/Users/liao/Projects/Vue/pug-vue/node_modules/pug-parser/index.js:12:20)
    at Object.parse (/Users/liao/Projects/Vue/pug-vue/node_modules/pug/lib/index.js:125:22)
    at Function.loadString [as string] (/Users/liao/Projects/Vue/pug-vue/node_modules/pug-load/index.js:45:21)
    at compileBody (/Users/liao/Projects/Vue/pug-vue/node_modules/pug/lib/index.js:86:18)
    at Object.exports.compile (/Users/liao/Projects/Vue/pug-vue/node_modules/pug/lib/index.js:242:16)
    at Object.module.exports (/Users/liao/Projects/Vue/pug-vue/node_modules/pug-plain-loader/index.js:11:24)

 @ ./src/App.vue?vue&type=template&id=7ba5bd90&lang=pug& 1:0-419 1:0-419
 @ ./src/App.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.1.172:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
@Justineo
Copy link
Member

Justineo commented Dec 8, 2018

pug templates shouldn't start with an indent.

<template lang="pug">
#app
  img(alt="Vue logo", src="./assets/logo.png")
  HelloWorld(msg="Welcome to Your Vue.js App")
</template>

This will resolve the error. Earlier versions of Vue (maybe vue-template-compiler) seemed to be more tolerable about this (which I think it shouldn't because pug is indent-sensitive).

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

No branches or pull requests

2 participants