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

data-umami-event html attribute disables Next.js <Link> client-side routing on mobile #2680

Open
dryu99 opened this issue Apr 16, 2024 · 0 comments

Comments

@dryu99
Copy link

dryu99 commented Apr 16, 2024

Describe the Bug

Not 100% sure if this is a Next.js issue or an Umami one, but thought I'd drop an issue here anyhow.

When I add an umami-event-data attribute to a Next.js <Link> tag like so:

<Link
  data-umami-event="example-link-click"
  href="/example"
>
  Example
</Link>

...clicking on the link causes a page-reload. This is unexpected behaviour since Next.js' <Link> tag is supposed to enable client-side routing. However when I remove this attribute, <Link> works as expected and no page reload occurs.

Notably this seems to only occur on mobile. On desktop, client-side routing works as expected even with umami-event-data.

Some context on the environment I tested this in:

  • Next.js version: 14.2.1
  • Mobile Device: iOS
  • Mobile Browsers: Safari and Chrome

Database

Umami Cloud

Relevant log output

No response

Which Umami version are you using? (if relevant)

No response

Which browser are you using? (if relevant)

Chrome, Safari

How are you deploying your application? (if relevant)

Vercel

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

No branches or pull requests

1 participant