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

vue-router warnings when leaving a url with useSetI18nParams(). #3049

Open
patriciorivera opened this issue Aug 3, 2024 · 1 comment
Open
Assignees
Labels
🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage routing v9

Comments

@patriciorivera
Copy link

Environment

  • Operating System: Windows 10
  • Node Version: v20.9.0
  • Nuxt Version: 3.12.4
  • Nitro Version: 2.9.7
  • Package Manager: npm@10.8.1
  • User Config: i18n, vite
  • Runtime Modules: @nuxtjs/i18n@8.3.3

Reproduction

https://stackblitz.com/~/github.com/patriciorivera/i18n
https://github.com/patriciorivera/i18n

Describe the bug

I'm not sure if it's a bug. It's possibly something I'm doing wrong, but I can't figure it out.

I'm getting vue-router warnings in the devtools when I'm on a page that has dynamic parameters and uses useSetI18nParams() and I go to another route that doesn't have parameters.

Reproduction:

  1. click on a product
  2. click about section or home

You will see vue-router warnings at chrome devtools

image

Additional context

No response

Logs

No response

@BobbieGoede BobbieGoede added v8 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing routing v9 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage and removed pending triage 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Aug 4, 2024
@BobbieGoede
Copy link
Collaborator

Thanks for reporting! It looks like the i18n params are reused (not cleared) while resolving the next route, in most cases this shouldn't be a problem.

There is a specific edge case when resolving a route (that should have parameters) without passing a parameters object. I have modified your reproduction to demonstrate the edge case here, note that the about us without params link only works after navigating to one of the product pages and reuses the product slug.

@BobbieGoede BobbieGoede self-assigned this Aug 4, 2024
@BobbieGoede BobbieGoede removed the v8 label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage routing v9
Projects
None yet
Development

No branches or pull requests

2 participants