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

Better error message for passing in incorrect parameter to startViewTransition? #218

Closed
Darkle opened this issue Dec 18, 2023 · 1 comment

Comments

@Darkle
Copy link

Darkle commented Dec 18, 2023

Hi, I had the following incorrect code:

let foo = () => {}
document.startViewTransition(foo())

which produced an error message of: TypeError: Failed to execute 'startViewTransition' on 'Document': Overload resolution failed.

My mistake of course was that the second line should instead be:

document.startViewTransition(foo)

However it took me a while to figure this out as I found the error message to be a bit confusing. Could it be improved a little? Maybe add a "startViewTransition expects a function" or something?

Cheers.

@vmpstr
Copy link
Collaborator

vmpstr commented Dec 18, 2023

Thank you for the suggestion. Unfortunately this is outside of our control. I believe this error message would be from bindings or something similar. I'm going to close as not actionable (by us)

@vmpstr vmpstr closed this as completed Dec 18, 2023
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

No branches or pull requests

2 participants