Closed rczdgbg closed 5 months ago
I'm having the same problem, but there's one more thing.
My switchLocale component is:
<script setup lang="ts">
import { LanguageIcon } from '@heroicons/vue/24/solid';
const { locale, locales } = useI18n();
const switchLocalePath = useSwitchLocalePath();
const otherAvailableLocales = computed(() => (locales.value).filter(i => i.code !== locale.value));
</script>
<template>
<NuxtLink v-for="locale in otherAvailableLocales" :key="locale.code" :to="switchLocalePath(locale.code)" class="btn btn-default">
<LanguageIcon class="btn--icon-left" /> {{ locale.name }}
</NuxtLink>
</template>
but classes router-link-active
and router-link-exact-active
are added in the generated code
<a aria-current="page" href="/en" class="router-link-active router-link-exact-active btn btn-default">...</a>
Perhaps this is an effect due to the problem described above?
I'm having the same problem too.
vue-router 4.3.1 There is a problem 4.3.0 no problem
@rczdgbg
You're right, a change in vue-router@4.3.1
breaks route resolution, possibly https://github.com/vuejs/router/pull/2189.
While we're trying to figure out why this is breaking I recommend overriding the version of vue-router
to 4.3.0
in your package.json as a temporary workaround, you can do so by adding the following to your package.json:
"overrides" {
"vue-router": "4.3.0"
}
You may have to remove lockfiles before installing to make this work.
The breaking change in vue-router@4.3.1
has been reverted and released in vue-router@4.3.2
, the workaround can be removed. Simply removing lockfiles and reinstalling dependencies should resolve this issue if you were experiencing it.
Closing this as resolved, if you're still experiencing issues let me know!
Still not working. My version: ^8.3.0
Still not working. My version: ^8.3.0
@xushnudbek20 Have you read the comments in this issue? If you're still experiencing this issue can you open a new issue with a minimal reproduction?
Environment
Node Version: v20.11.0 Nuxt Version: 3.11.2 CLI Version: 3.11.2 Nitro Version: 2.9.6 Package Manager: pnpm@9.0.2
Reproduction
https://stackblitz.com/edit/github-a5wazj-tp1y9r?file=pages%2Findex.vue
Describe the bug
defaultLocale:'en' expect: switchLocalePath("en") ---> / switchLocalePath("de") ---> /de result: switchLocalePath("en") ---> / switchLocalePath("de") ---> /
Additional context
No response
Logs
No response