Skip to content

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

@dword-design

Description

@dword-design

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions