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

[Bug]: Vue states are missing after HMR in Rsbuild 1.2.x #4467

Open
xbzhang2020 opened this issue Feb 1, 2025 · 1 comment
Open

[Bug]: Vue states are missing after HMR in Rsbuild 1.2.x #4467

xbzhang2020 opened this issue Feb 1, 2025 · 1 comment
Assignees

Comments

@xbzhang2020
Copy link
Contributor

Version

System:
    OS: macOS 15.2
    CPU: (14) arm64 Apple M4 Pro
    Memory: 12.70 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 132.0.6834.160
    Safari: 18.2
  npmPackages:
    @rsbuild/core: ^1.1.8 => 1.2.3 
    @rsbuild/plugin-vue: ^1.0.5 => 1.0.5

Details

My Vue component is as follows:

<script lang="ts" setup>
import { ref } from "vue";
const count = ref(0);
</script>

<template>
  <div class="content">
    <h1>Rsbuild with Vue</h1>
    <p>Start building amazing things with Rsbuild.</p>

    <button @click="count++">+</button>
    <span>{{ count }}</span>
    <button @click="count--">-</button>
  </div>
</template>

In dev mode, after I modified the text in <p>, the state of count was held well in Rsbuild 1.1.14.

Image

But after I upgraded @rsbuild/core to 1.2.3, the state of count was reset to 0.

Image

Reproduce link

https://github.com/xbzhang2020/rsbuild-vue-bug

Reproduce Steps

  1. Run pnpm i & pnpm dev
  2. After clicking the button some times, modify the text in p.
@chenjiahan
Copy link
Member

Related issue: #3217

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

3 participants