Skip to content

Conversation

@mdoesburg
Copy link

@mdoesburg mdoesburg commented Nov 7, 2025

fixes #22302

Description

This PR fixes a TimeoutNaNWarning that occurs in newer Node versions when defer() is called with an invalid timeout value (NaN). Newer Node versions emit this warning when setTimeout() is invoked with NaN, while browsers silently coerce it to 0.

@J-Sek
Copy link
Contributor

J-Sek commented Nov 7, 2025

Is it fixing the problem or just hiding it?
Is there a good reason to leave defer executions with NaN?

@J-Sek J-Sek closed this in a47d32a Nov 7, 2025
@mdoesburg
Copy link
Author

mdoesburg commented Nov 7, 2025

Is it fixing the problem or just hiding it? Is there a good reason to leave defer executions with NaN?

It’s not hiding the issue per se. In browsers setTimeout(NaN) runs immediately with no warning, while newer Node versions log a warning but behave the same. This change makes defer() match browser behavior and keeps test output and CI logs clean. The root cause is in useDelay, but fixing it here keeps behavior consistent across environments, and guards against future use.

Would you prefer addressing it only in useDelay, or in both places for extra safety?

J-Sek added a commit that referenced this pull request Nov 7, 2025
@mdoesburg mdoesburg deleted the fix/22302-defer-nan-warning branch November 7, 2025 23:48
@J-Sek
Copy link
Contributor

J-Sek commented Nov 8, 2025

I get the argument. Thanks for the additional explanation. Seems like the cross-environment consistency calls for more changes, but I don't think we are into it to the extent that would justify a setTimeout wrapper. If we had it, seems more appropriate to throw an error instead. Browsers (and probably execution environments in general) have an incentive to silently accept NaN. This warning is probably a small step to eventually stop doing it.

I will keep the idea shelved for now. Thank you for the input and interest in improving Vuetify 👍🏼

pgalhardo pushed a commit to pgalhardo/vuetify that referenced this pull request Nov 23, 2025
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 this pull request may close these issues.

[Bug Report][3.10.9] Vuetify triggers TimeoutNaNWarning in newer Node versions due to NaN timeout in defer()

2 participants