Skip to content

Conversation

vitpetricak
Copy link
Contributor

πŸ”— Linked issue

Resolves #4959

❓ 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

According to typechecking error message, it is not possible to have object in ambient types. This fix resolves it by replacing const icons by defining it as a type.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

pkg-pr-new bot commented Sep 15, 2025

npm i https://pkg.pr.new/@nuxt/ui@4991

commit: 58fa7b6

@sandros94
Copy link
Member

sandros94 commented Sep 15, 2025

Great catch! I knew something was off with that one!

Tho, now that I think of it, this could create more issues (on a type inpout perspective)

EDIT:

yes it would get constrained to a specific icon
image

@sandros94
Copy link
Member

@vitpetricak hope you don't mind if I jumped in with the small 58fa7b6 fix

@benjamincanac this also allow defining your custom icons with type support!
image
image
image

@vitpetricak
Copy link
Contributor Author

vitpetricak commented Sep 15, 2025

@vitpetricak hope you don't mind if I jumped in with the small 58fa7b6 fix

Not at all, I tried to check if the types would work properly, but for some reason the defineAppConfig types for me were not working. The ui object was typed as any - but I suspected it is error somewhere on my side. The fix you did seems to be correcting that behavior?

So thank you so much for fixing that :) This was blocking us whole last week and I was happy to fix at least the part that blocked us.

@sandros94
Copy link
Member

Not at all, I tried to check if the types would work properly, but for some reason the defineAppConfig types for me were not working. The ui object was typed as any - but I suspected it is error somewhere on my side. The fix you did seems to be correcting that behavior?

Yes your local ts server might hang/crash the first time you start the local dev of this library and type stuff as any. Now it works perfectly, while also leaving room for downstream customization

So thank you so much for fixing that :) This was blocking us whole last week and I was happy to fix at least the part that blocked us.

No, thank you.
When you opened that issue I was almost sure, but not completely, that had to be a different problem from the other defineProps issues we have

@benjamincanac benjamincanac changed the title fix(types): fix ambient type declaration error by replacing const with type fix(types): resolve ambient declaration error in icons types Sep 16, 2025
@benjamincanac benjamincanac changed the title fix(types): resolve ambient declaration error in icons types fix(types): resolve ambient declaration error in icons type Sep 16, 2025
Copy link
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I believe this was one of the first things I did on v3 πŸ˜…

@benjamincanac benjamincanac merged commit 6ddf899 into nuxt:v4 Sep 16, 2025
15 checks passed
benjamincanac pushed a commit that referenced this pull request Sep 16, 2025
Co-authored-by: Sandro Circi <sandro.circi@digitoolmedia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

defineProps does not accept types created by TypeScripts' Pick type after installing Nuxt UI 4

3 participants