[vue] process hangs due to babel parser error #12112
Labels
area:multiparser
Issues with printing one language inside another, like CSS-in-JS
lang:vue
Issues affecting Vue
type:bug
Issues identifying ugly output, or a defect in the program
Prettier 2.5.1
Playground1
Input 1:
Output 1:
Playground2
Input 2:
Output 2:
Expected behavior:
Output 2 should be the expected behavior of both Input 1 and Input 2 since both inputs is a vue syntax error missing the RHS of a
v-for
The current problem is, while the playground here successfully return Output 1 as an error, however, Output 1 is thrown at the
babel-parser
level. When you try to run this Input 1 yourself in your own CLI, with the default highlighting turned on, the parser error will bubbles to the top and go through the highlighting process bycodeFrameColumns (from @babel/code-frame)
, with an emptytext = ""
value.prettier/src/main/parser.js
Line 103 in 514046b
When you step into the implementation, the code loops infinitely inside the
tokenize*
generator function.TL;DR
So the current behavior is, when you run Input 1 in a CLI terminal (i.e. save the code in a file e.g.
abc.vue
and run$ prettier abc.vue
) with highlighting turned on, the process hangs, and CPU is at 100%.The text was updated successfully, but these errors were encountered: