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

navigateTo(localePath()) in useLazyAsyncData does nothing #3405

Open
aleksandar-brkic opened this issue Mar 12, 2025 · 0 comments
Open

navigateTo(localePath()) in useLazyAsyncData does nothing #3405

aleksandar-brkic opened this issue Mar 12, 2025 · 0 comments

Comments

@aleksandar-brkic
Copy link

Environment

  • Operating System: Linux
  • Node Version: v18.20.3
  • Nuxt Version: 3.16.0
  • CLI Version: 3.22.5
  • Nitro Version: 2.11.6
  • Package Manager: [email protected]
  • Builder: -
  • User Config: compatibilityDate, devtools, modules
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-8ekrd9jd?file=pages%2Fpage1.vue

Describe the bug

If navigateTo(localePath('/')) in useLazyAsyncData is called before the useLocalePath composable, navigation does not occur server side. In the reproduction, if you click the link to page1 in the header the navigation is there. However, if you type in /page1 manually in the container you will see that you actually land there and not get redirected to index.

If you move const localePath = useLocalePath() to a line before useLazyAsyncData, the redirect will perform as expected on server side as well.

In the current state it just does nothing -> no navigation and no error.

Additional context

No response

Logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant