pug-plain-loader: Unexpected token "indent" on Vue 3 template
Vue version: 3.0.1
Related issue: vuejs/rollup-plugin-vue#86
With the default indentation style of 2 spaces on templates, I’m getting the following issue:
1|
> 2| div(:class="styleClasses")
-------^
3| span(
4| contenteditable
5| ref="textField"
unexpected token "indent"
This doesn’t seem to happen on version 2 though.
–
Possible solution #17
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 2
- Comments: 27
I found a temporary solution for it: Not put the indent at the first line in template and it works well.
Same problem, cant use beautifier due of this. Should be fixed as vue3 coming fast to get as daily.
Is this problem resolved ?
Thank u! It works.
@avinmaster
According my newest information, in Vue 3 - no. Current workaround is @webdiscus/pug-loader.
If resolved, I am sorry at advance.
Note that for some of you, coming from a search engine, as for me, this error might not be related to this repo! This is the stack trace I got with
nuxt3
+vue3
+pug
and an SFC component, with the contents of<template lang="pug>
being indented:The only packages involved here are:
@vue/compiler-sfc
pug
pug-load
pug-parser
pug-error
In my case, I think
@vue/compiler-sfc
should dedent the code before sending it to thepug
library.@TokugawaTakeshi
For a question you can open new discussion. For a bug or feature request open new issue. For help with a configuration, create a repo and new issue with link to the repo.
@TokugawaTakeshi you can use the @webdiscus/pug-loader.
This Pug loader supports for an indent (spaces and tabs) in Vue template:
This Pug loader works with Vue 3. Here is source of usage example. See please how to setup Pug loader.