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

Strict templates should report unknown events #3718

Closed
IceBlizz6 opened this issue Nov 8, 2023 · 11 comments
Closed

Strict templates should report unknown events #3718

IceBlizz6 opened this issue Nov 8, 2023 · 11 comments
Labels
enhancement New feature or request good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@IceBlizz6
Copy link

Strict templates reports unknown components and unknown props.
I would also like it to report unknown events.

<router-link
    to="/contact"
    @eventDoesNotExist="doSomething"
>
    Text here
</router-link>

In this example vue-tsc should report an error which states that eventDoesNotExist is not defined on router-link.

@so1ve so1ve added the enhancement New feature or request label Nov 9, 2023
@IceBlizz6
Copy link
Author

@so1ve
I would love for this to get some attention, but i also suspect that there are many other more important issues.
I wanted to look into the possibility of fixing this myself, but have not touched this code base before.
Would you be able to give me some pointers on where in this code base that i could start in order to fix this?

@so1ve
Copy link
Member

so1ve commented Jan 3, 2024

You can install the Volar labs extension then you can inspect the generated virtual code in your sidebar.

@so1ve
Copy link
Member

so1ve commented Jan 4, 2024

image
I've tested locally and this seemed to work

@IceBlizz6
Copy link
Author

tested locally and this seemed to work

Thanks a lot!
Are you planning to merge this into the next version?

@so1ve
Copy link
Member

so1ve commented Jan 4, 2024

Sorry, I couldn't explain it clearly. I mean vue-tsc has currently reported unknown events (with strictTemplates: true 💦

Oh it doesn't report when I add a to prop

@IceBlizz6
Copy link
Author

I tested it now,
you're right, this actually works when no props are present.
And then it stops working when props are assigned.

So it seems like the current behavior is bugged.

@IceBlizz6
Copy link
Author

Maybe we should remove the 'enhancement' tag,
replace it with a tag indicating that this is a bug.

@so1ve so1ve added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first and removed enhancement New feature or request labels Jan 8, 2024
@IceBlizz6
Copy link
Author

Hey @so1ve

There hasn't been any updates on this recently.
Strict mode is very important for us and it would be great to see a fix soon.

If you are busy with other things then i completely understand,
But in that case maybe you could point us to another developer which may be able to assist.

@IceBlizz6
Copy link
Author

I'd hate to bump this again, but would be great if someone could look into this bug.
It's an important feature and it's broken.
We have a working reproduction.
Is there anything else i can provide?

@IceBlizz6
Copy link
Author

Hey @so1ve
Did you figure out a solution here?

@johnsoncodehk johnsoncodehk added enhancement New feature or request and removed bug Something isn't working labels May 13, 2024
@so1ve
Copy link
Member

so1ve commented May 13, 2024

Unfortunately I didn't, my solution breaks vue 2.7 tests.

johnsoncodehk added a commit that referenced this issue Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

3 participants