nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.75k stars 483 forks source link

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

Open patriciorivera opened 3 months ago

patriciorivera commented 3 months ago

Environment

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 commented 3 months ago

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.