Skip to content

Page reloading when navigating, having a global middleware with getCurrentUser and having node_modules/.cache/vite cleared #1624

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

Closed
dword-design opened this issue May 6, 2025 · 1 comment

Comments

@dword-design
Copy link

dword-design commented May 6, 2025

Reproduction

https://github.com/dword-design/demo-vuefire-page-reloads-cache

Steps to reproduce the bug

When using getCurrentUser in a middleware and clearing the cache via nuxi cleanup, page navigation always reloads the page instead of staying client-side when running nuxt dev. Very weird. Actually it only happens when deleting the node_modules/.cache/vite dir.

When rerunning nuxt dev it's working as expected.

Additional observation: Is only the case for a global middleware. When setting one via definePageMeta it's working as expected.

  1. rm -rf node_modules/.cache/vite && pnpm dev
  2. Click on Login

Expected behavior

The page is switched without reloading the page.

Actual behavior

The page is reloaded.

Additional information

Probably related to #1625.

@dword-design dword-design changed the title Page reloading when navigating, having a middleware with getCurrentUser and having node_modules/.cache/vite cleared Page reloading when navigating, having a global middleware with getCurrentUser and having node_modules/.cache/vite cleared May 6, 2025
Copy link
Member

posva commented May 6, 2025

I think this is just vite rebounding (optimizing) deps and reloading the page

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants