-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Compiler should error on the start of a new element with the current element unclosed, instead of onClose #13319
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
Comments
Please follow the issue requirement and provide a minimal reproduction. |
I'm an old dog. I don't use these modern new-fangled tools - my work environment consists of vi and grep. I also don't know enough about these languages to generate a new module of any sort, I just modify existing code. So creating a minimal example is beyond my knowledge. So, instead of you dragging me into the 2020s, let's see if I can drag you back to the 1980s, where you would be happy to get a well worded problem report, giving you the example of what worked and what didn't, with a clear description of what the problem is and what the expected solution is, and then you go from there. It should be really easy for you to reproduce from my description. Just start a second tag without closing the first one at all. The error should happen on opening the second tag, not on closing it. And it should say something meaningful like |
Thanks @edison1105 for adding the example. I might even be able to do something like that in the future. |
Question: If we make special handling for Since this is the browser behavior, I think we should not cause it to fail during compilation. |
Vue version
"@vue/compiler-sfc": "^3.3.7"
Link to minimal reproduction
The reproduction is in the Steps to reproduce. It's really straightforward.EDIT:
https://play.vuejs.org/#eNp9kU9PwzAMxb9K5fPUiT+nqSAB2gEOgIBjLlVrSkaaRLFTKk397jip1u0wLZfE7/1sPSt7ePC+HCLCBipqgvZcEHL098pW61mQpxSMvTc1YzJaPShbFLbu8U7BlYJUVeRrAQs5uhX5epaFTxKG4ELG1onL42VMvpfRsAKmxtlv3ZU7clZC7VOPgsb1XhsMb561s6RgU2QnebUx7u8laxwirg5684PN7xl9R2PSFLwHJAwDKlg8rkOHPNvbz1cc5b2YvWujEfqC+YHkTEwZZ+wx2lZin3A57XPvXWBtuy/ajoyWDkuloImcMq9AfubpwurHuDflbe5TdoLpH/l5mKk=
Steps to reproduce
I'm a newbie, and tried to reorder two tags. They were consecutive and I wanted the second one nested. When I put it inside the first I got an "invalid end tag" pointing at the end of the embedded tag. It would have been really helpful if instead it had pointed to the start of that tag, and given an explicit message like: Can't start a new tag without end the previous tag" or something like that:
I tried to change it to:
I figured out the trailing
</q-btn>
but the errorInvalid end tag
pointing at the /one-tooltip wasn't helpful. Can you make it so that when you get the <one-tooltip without me closing the <q-btn that you error on opening the tag, with a nice clear error message, rather than waiting to the onClose to tell me that mysteriously you can't find the one-tooltip to close (which is clearly very misleading).What is expected?
Error earlier, and more meaningfully. I think that it's invalid to open the <one-tooltip without providing the
>
for q-btn, so that should be a syntax error that is explicit.What is actually happening?
Misleading error message on closing the next tag, instead of on opening it.
System Info
Any additional comments?
Sorry. I'm an old dog trying to learn new tricks, and my exposure to Vue and js is very minimal, so I don't have anywhere near enough knowledge to build a fake example for you on a website. But I think the description is pretty clear, so I hope you can fix it anyway.
Stack trace:
The text was updated successfully, but these errors were encountered: