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

[Bug]: Tooltip not showing up when rendered on the server #848

Closed
remonke opened this issue Apr 14, 2024 · 2 comments
Closed

[Bug]: Tooltip not showing up when rendered on the server #848

remonke opened this issue Apr 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@remonke
Copy link
Contributor

remonke commented Apr 14, 2024

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: pnpm@8.6.0
Radix Vue version: 1.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework: tailwindcss@3.3.3
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

https://stackblitz.com/edit/nuxt-starter-hrb7vm?file=app.vue%2Cnuxt.config.ts

Steps to reproduce

Render a Tooltip using SSR and try to use it upon client-side hydration.

Describe the bug

As in the title.

Expected behavior

No response

Context & Screenshots (if applicable)

No response

@remonke remonke added the bug Something isn't working label Apr 14, 2024
@remonke
Copy link
Contributor Author

remonke commented Apr 14, 2024

Okay I discovered the issue is with the way the event handlers are bound to the TooltipTrigger. The event listeners come from a computed, with for some reason doesn't play with SSR.

v-bind="tooltipListeners"

I suggest using some alternative way to disable the Tooltip (perhaps keeping the listeners, and just make them do nothing?). I added the example in the reproduction demo.

@nethriis
Copy link

I have the same issue but the way you handle that error with ClientOnly is dirty, it doesn't display the element inside TooltipTrigger on the server rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants