-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
fix(compiler-sfc): remove first-line indent for pug or jade #3842
Conversation
same problem, it's not friendly for migration |
Bumping this up -> Can't migrate to Vue 3 due to this issue |
Since I submitted this PR, no one has dealt with it for more than 5 months. I don't want to wait any longer and decide what to do on my own. So I do that, You can also try my loader named I wrote a bit hastily. I didn't even submit the git link, but I will improve it later. If you have any suggestions, please contact me directly. |
Any update on this? |
I'm sorry it took so long to reply, it's been a year before I know it, and there is still no progress on this PR. The following modifications may be made next:
|
As a workaround you could try https://github.com/prettier/plugin-pug and do not set |
How to fix that, i have same error today. Its complete project, what working 2 years, nad that problems goin only today in 1765 files, wow. How i can ifx that? |
i have same problem 2 days ago( |
I'm sorry, I haven't had time to deal with this issue because I've been too busy recently, but as the author of this PR, seeing more and more similar issues below, I still think I should know where your problems are, so that you can provide the following information? ?
If it is based on webpack, I have a reply above, you can refer to my vue-template-pug-remove-indent-loader This package, due to the review of Gitee (currently unable to view the repo), I will migrate it to GitHub as soon as possible, and the solution for Vite will come out as soon as possible. Please wait. Until there is no official solution (it's been over a year and my PR still hasn't been merged) by Vue.js team, I'll try my best to help you solve the problem. |
Cant migrate my project too. Any update on this? |
idk, this pug indentation thing works on webpack, but not with vite, so i should remove the indent manually, I wonder how webpack team solve this issue |
Any update on this? |
Pug does not work with vite... Great... |
I made a minimal reproduction repository for the problem: https://github.com/rudolfbyker/vue-pug-indent-reproduction and a new PR: #7723 |
Having the same issue when migrating a project from Vue 2 to Vue 3. The PR seems ready, does something prevent it from being merged ? Regards |
See 6345197 |
See #3231 。
When we use template, we often need to use indentation to ensure the formatting and readability of the content, also includes pug / jade。
However, when the Vue SFC compiler preprocesses the template, it removes the outer tags and sends the contents directly to the template compiler, while the pug / jade compiler does not recognize indentation.
Correspondingly, Vue will also report an error:
I had to remove the indentation every time so that there were no spaces in front of the first line of content:
After repeating this operation countless times, I realized that something should be done, maybe the logic of the compiler should be modified.
So I do that.
In addition, there is another detail. I don't know why Prettier's version is locked at 1.x, which makes it not aware of TypeScript's new syntax:
I had to change to another approach, which resulted in the definition of an additional variable.