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

due to my template syntax error, terminal stuck... loose control #12623

Open
chengfengfengwang opened this issue Jul 6, 2022 · 4 comments · May be fixed by #12830
Open

due to my template syntax error, terminal stuck... loose control #12623

chengfengfengwang opened this issue Jul 6, 2022 · 4 comments · May be fixed by #12830

Comments

@chengfengfengwang
Copy link

chengfengfengwang commented Jul 6, 2022

Version

2.7.3

Reproduction link

github.com

Steps to reproduce

npm install
npm run dev

What is expected?

server run normal, show syntax error in App.vue; not loose response

What is actually happening?

vue v-bind error cause terminal loose control, i have to kill it to restart. it is like a vue-loader error, but i am not sure.

@codeArtisanry
Copy link

codeArtisanry commented Jul 16, 2022

Is it anyhow related to the system's low specs?

@spiltcoffee
Copy link

spiltcoffee commented Jul 26, 2022

I'm getting the same issue occurring - a syntax error on v-slot usage is resulting in an apparent freeze.

Looking in Task Manager on Windows, the node.exe for my build is using up a whole core of my CPU, so it's not waiting on anything - instead, it looks like it might be stuck in a loop.

I attached a debugger, profiled, and found the build was spending a lot of time here:
https://github.com/vuejs/vue-loader/blob/master/lib/loaders/templateLoader.js#L82

So, ran the build again with a breakpoint, and stepped into the function. It looks like it's getting into an infinite loop over these lines, when j is larger than lines.length:
https://github.com/vuejs/vue/blob/main/src/compiler/codeframe.ts#L14-L15

I'll see if I can get a small reproduction of the issue.

@spiltcoffee
Copy link

spiltcoffee commented Jul 26, 2022

Alright, got a reproduction of the issue as well: https://github.com/spiltcoffee/vue-syntax-loop-example

Curiously, this particular error is only happening when using a separate file for the template source. If I stick the contents into a <template> tag inside the .vue file, it's "fine" (as in the build finishes and I see the expected error).

@sawmurai sawmurai linked a pull request Oct 15, 2022 that will close this issue
13 tasks
@sawmurai
Copy link

Thanks to @spiltcoffee's repo and analysis I created that PR with a fix. There is also a way older PR that fixes the bug in an older version of the codebase: #10547 ... well, and another one here: #12338

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

Successfully merging a pull request may close this issue.

4 participants