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

fix: loadIcon always console warn #272

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

geforseN
Copy link
Contributor

@geforseN geforseN commented Oct 7, 2024

πŸ”— Linked issue

resolves #271

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR addresses an issue where the console warning [Icon] loading icon <name> timed out after <timeout>ms would be shown, even though the icons were loaded successfully. This happened due to incorrect handling of icon loading timeouts.

Changes introduced:

  1. Improved error handling: Now, if _loadIcon fails to load the icon, a specific warning message [Icon] failed to load icon <name> will be logged, giving more visibility into failed loads.
  2. Timeout handling fix: The timeout warning [Icon] loading icon <name> timed out after <timeout>ms will now only appear if the icon fails to load within the specified timeout period.
  3. Cleanup with finally: Ensures that the timeout warning is cleared properly whether the icon is loaded successfully or fails.

πŸ“ Additional context

If you only want the bug fix (c072229e163fcf738c22fe1bfea9178434651419), you can pick only that specific commit

Sorry, something went wrong.

@JessicaSachs
Copy link

JessicaSachs commented Oct 8, 2024 β€’

Heh, you beat me to it. Was about to submit a patch. πŸ™ˆ

@antfu antfu merged commit b6cd843 into nuxt:main Oct 8, 2024
1 check passed
@antfu antfu mentioned this pull request Oct 28, 2024
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.

loadIcon always shows console warning despite successful icon load
3 participants