You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix from #3165 appears to exist in @radix-ui/react-slot@1.2.4, but the latest published @radix-ui/react-dialog@1.1.15 still resolves @radix-ui/react-slot@1.2.3.
In our app, DialogTrigger asChild still breaks in a React Server Components setup when the trigger element is created on the server and passed into a client component.
With the published packages, the trigger works inconsistently in dev and disappears in our production build after hydration.
Expected behavior
DialogTrigger asChild should work in production when the child trigger is created on the server and passed into a client component.
If the fix from #3165 is the intended fix for this class of problem, the published @radix-ui/react-dialog package should pick it up in practice.
Reproducible example
We have not reduced this to a public repro yet, but the failing pattern is:
Bug report
Current Behavior
The fix from #3165 appears to exist in
@radix-ui/react-slot@1.2.4, but the latest published@radix-ui/react-dialog@1.1.15still resolves@radix-ui/react-slot@1.2.3.In our app,
DialogTrigger asChildstill breaks in a React Server Components setup when the trigger element is created on the server and passed into a client component.With the published packages, the trigger works inconsistently in dev and disappears in our production build after hydration.
Expected behavior
DialogTrigger asChildshould work in production when the child trigger is created on the server and passed into a client component.If the fix from #3165 is the intended fix for this class of problem, the published
@radix-ui/react-dialogpackage should pick it up in practice.Reproducible example
We have not reduced this to a public repro yet, but the failing pattern is:
Server component:
Client component:
Suggested solution
Publish a
@radix-ui/react-dialogrelease that picks up the Slot fix from #3165, or confirm the intended supported version/workaround.Forcing
@radix-ui/react-slot@1.2.4fixes the issue for us without any component-level workaround:{ "pnpm": { "overrides": { "@radix-ui/react-slot": "1.2.4" } } }After that override, the same production build works correctly and the dialog opens as expected.
Additional context
This looks like a published-package / release gap rather than a new root-cause bug:
@radix-ui/react-slot@1.2.4appears to contain the fix fromasChilddoesn't work with async components #3165@radix-ui/react-dialog@1.1.15still resolves@radix-ui/react-slot@1.2.31.2.4fixes the production failure for usRelated: #3165, #3416
Your environment
@radix-ui/react-dialog,@radix-ui/react-slot1.1.15,1.2.319.2.xpnpm10.x