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

Hash in NuxtLink don't work with LocalePath #2525

Closed
NtchPlayer opened this issue Oct 25, 2023 · 3 comments · Fixed by intlify/routing#79 or #2534
Closed

Hash in NuxtLink don't work with LocalePath #2525

NtchPlayer opened this issue Oct 25, 2023 · 3 comments · Fixed by intlify/routing#79 or #2534
Labels
❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf routing v8 workaround

Comments

@NtchPlayer
Copy link

NtchPlayer commented Oct 25, 2023

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.8.0
  • CLI Version: 3.9.1
  • Nitro Version: 2.7.0
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, build, modules, i18n
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-ynzoxn

Describe the bug

When you add a hash to a link with localePath like this:

<NuxtLink :to="localePath({ name: 'about', hash: '#myHash' })">
  My link with a hash
</NuxtLink>

The Hash of link is not add to the generated tag

<a href="/en/about">My link with a hash</a> // #myHash is missing

Additional context

No response

Logs

No response

@NtchPlayer NtchPlayer changed the title Hash in link don't work with LocalePath Hash in NuxtLink don't work with LocalePath Oct 25, 2023
@kazupon kazupon added v8 routing 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf and removed pending triage 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Oct 27, 2023 — with Volta.net
@BobbieGoede
Copy link
Collaborator

This issue should be fixed upstream when intlify/routing#78 is merged and the dependency is updated.

The issue only happens for links without query parameters so it's possible to add query parameters to the link for the hash to work. In the meantime a better workaround would be to pin vue-i18n-routing to its previous version 1.1.1, which doesn't have this issue.

@NtchPlayer
Copy link
Author

Thx for your precision !

@kazupon
Copy link
Collaborator

kazupon commented Nov 4, 2023

reopen, so We have not still integrate vue-i18n-routing latest version

BobbieGoede added a commit that referenced this issue Nov 4, 2023
kazupon added a commit that referenced this issue Nov 5, 2023
* fix: bump deps

* chore: more bump deps

* fix: revert vue-i18n and unplugin-vue-i18n version

* test: add regression test for #2525

* test: add regression test for #2523

---------

Co-authored-by: Bobbie Goede <[email protected]>
BobbieGoede added a commit to BobbieGoede/i18n that referenced this issue Nov 6, 2023
DarthGigi pushed a commit to DarthGigi/i18n that referenced this issue Apr 16, 2024
* fix: bump deps

* chore: more bump deps

* fix: revert vue-i18n and unplugin-vue-i18n version

* test: add regression test for nuxt-modules#2525

* test: add regression test for nuxt-modules#2523

---------

Co-authored-by: Bobbie Goede <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf routing v8 workaround
Projects
None yet
3 participants