Skip to content

encounter " Hydration node mismatch" when using keep-alive in ssr rendering  #4817

@tcstory

Description

@tcstory

Version

3.2.20

Reproduction link

github.com

Steps to reproduce

first, change the App.vue file to the following( replace <Suspense> with <keep-alive>)

<template>
  <div>
    <router-link to="/">Home</router-link>|
    <router-link to="/about">About</router-link>
    <router-view v-slot="{ Component }">
      <keep-alive>
        <component :is="Component" />
      </keep-alive>
    </router-view>
  </div>
</template>

second, run pnpm run dev
third, access http://localhost:3000/

and you will see the error in console panel.

What is expected?

no error is reported

What is actually happening?

there is a error


even though the reproduction project is using vite, the error is still there when you using webpack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❗ p4-importantPriority 4: this fixes bugs that violate documented behavior, or significantly improves perf.🐞 bugSomething isn't workingscope: ssr

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions