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]: plugin-preview not rerender after code change #1652

Closed
liuwenzhuang opened this issue Dec 11, 2024 · 2 comments · Fixed by #1654
Closed

[Bug]: plugin-preview not rerender after code change #1652

liuwenzhuang opened this issue Dec 11, 2024 · 2 comments · Fixed by #1654
Labels
🐞 bug Something isn't working

Comments

@liuwenzhuang
Copy link
Contributor

liuwenzhuang commented Dec 11, 2024

Version

System:
    OS: Linux 5.15 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 10.97 GB / 15.62 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  npmPackages:
    rspress: ^1.38.0 => 1.38.0

Details

I have configure @rspress/plugin-preview plugin into rspress.config.ts,and in mdx file write code like below:

export default () => <div>test 1</div>

open localhost:3000 after pnpm dev, the preview component show test 1, and then change the test 1 to test 2, the preview component not rerender, the component still show test 1, the code area show test 2 however.

Image

Reproduce link

https://codesandbox.io/p/devbox/jxvk3m

Reproduce Steps

  1. pnpm i && pnpm dev
  2. change code in docs/index.mdx
  3. the preview component not rerender
@liuwenzhuang liuwenzhuang added the 🐞 bug Something isn't working label Dec 11, 2024
@liuwenzhuang
Copy link
Contributor Author

liuwenzhuang commented Dec 11, 2024

Maybe the reason is watchOptions exclude files in /node_modules/, and the preview components is located in node_modules/.rspress/virtual-demo/`.

@Timeless0911
Copy link
Collaborator

Yes, this is related to a change in Rsbuild web-infra-dev/rsbuild#4058, we improve performance by ignoring node_modules formly. I think @rspress/plugin-preview plugin should watch node_modules to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants