Skip to content

Conversation

@Teages
Copy link
Contributor

@Teages Teages commented Dec 29, 2025

πŸ”— Linked issue

Resolves #4413

Related #4414

❓ 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

Recent updates to Nuxt have changed the order of emit function overload signatures, moving the hydrated signature to the start. This breaks the previous patch, which relied on a specific signature order. This PR uses a combined approach to handle both orderings, fixing the regression.

TS Playground

// works for both
interface A {
  (e: 'close', res: boolean): void
}

// only work before #4414
interface B {
  (e: 'hydrated'): void
  (e: 'close', res: boolean): void
}

// only work after #4414
interface C {
  (e: 'close', res: boolean): void
  (e: 'hydrated'): void
}

The PR needs to be cherry-pick to v3 branch

πŸ“ Checklist

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 29, 2025

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

commit: 5ee31ad

@benjamincanac benjamincanac requested a review from genu December 29, 2025 17:51
@genu
Copy link
Member

genu commented Jan 6, 2026

Thanks @Teages I think this looks good.

Do you know which upstream change actually cause it to break?

@Teages
Copy link
Contributor Author

Teages commented Jan 6, 2026

Do you know which upstream change actually cause it to break?

In nuxt/nuxt#33046 it got reversed.

- type LazyComponent<T> = (T & DefineComponent<HydrationStrategies, {}, {}, {}, {}, {}, {}, { hydrated: () => void }>)
+ type LazyComponent<T> = DefineComponent<HydrationStrategies, {}, {}, {}, {}, {}, {}, { hydrated: () => void }> & T

I think it's time to get Type Testing.

@genu
Copy link
Member

genu commented Jan 6, 2026

Thanks for the clarification @Teages

I think it's time to get Type Testing.

^ @benjamincanac ☝️

@benjamincanac benjamincanac merged commit 182af20 into nuxt:v4 Jan 7, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useOverlay can't infer the result type of lazy load components

3 participants