Skip to content
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

Pug templates fail if the first line has indentation #7594

Closed
7 tasks done
Tumulte opened this issue Apr 3, 2022 · 9 comments
Closed
7 tasks done

Pug templates fail if the first line has indentation #7594

Tumulte opened this issue Apr 3, 2022 · 9 comments
Labels
bug: upstream Bug in a dependency of Vite

Comments

@Tumulte
Copy link

Tumulte commented Apr 3, 2022

Describe the bug

Pug templates fail if the first line has indentation, meaning, this works :

<template lang=pug>
div
    span
</template>

and this doesn’t

<template lang=pug>
    div
        span
</template>

(the error is unexpected token indent)

Is it possible to allow users to make the choice they prefer ? It made my webpack->vite migration a chore :)

(reproduction : just install pug and try an SFC with lang="pug")

Reproduction

stackblitz

System Info

System:
    OS: macOS 12.3
    CPU: (8) x64 Apple M1
    Memory: 48.59 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.1 - /usr/local/bin/node
    npm: 7.20.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 100.0.4896.60
    Firefox: 95.0.1
    Safari: 15.4

Used Package Manager

npm

Logs

No response

Validations

@github-actions
Copy link

github-actions bot commented Apr 3, 2022

Hello @Tumulte. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@bluwy
Copy link
Member

bluwy commented Apr 3, 2022

I can’t find how build a pen with SFC and pug :/

You can duplicate your setup in a stackblitz project, which should work too

@Shinigami92
Copy link
Member

Just a random guess because someone else had an issue with that as well,
could you try to install pug as a local devDependency? (I did not try it myself)

@Tumulte
Copy link
Author

Tumulte commented Apr 3, 2022

I’ve only tried it as a local devDependency :)

@Shinigami92
Copy link
Member

I’ve only tried it as a local devDependency :)

Okay, then please setup a reproducible so we can try investigate and debug it

@Tumulte
Copy link
Author

Tumulte commented Apr 3, 2022

It’s already done ;) but I only edited the original issue without commenting

@Shinigami92
Copy link
Member

So the only "reference" to pug I found here:

if (block.lang === 'pug') {

I wanted to add plugin: vue but @bluwy was faster 🤷
I'm not used to the source code of Vite, so if someone want to pick this up, please feel free 🙂

@patak-dev
Copy link
Member

For reference, linking the Vue core issue that @btea added in the PR: vuejs/core#3842

@patak-dev patak-dev added bug: upstream Bug in a dependency of Vite and removed bug labels Apr 7, 2022
@patak-dev
Copy link
Member

Closing, as @sodatea said, this should be solved upstream. There is nothing actionable in core in this issue

@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: upstream Bug in a dependency of Vite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants