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]: react-refresh not working when i use observer hoc,and works fine if i remove observer or put it inside function component file. #5655

Closed
ssehacker opened this issue Feb 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working stale upstream

Comments

@ssehacker
Copy link

System Info

System:
OS: macOS 13.3
CPU: (12) arm64 Apple M2 Max
Memory: 102.83 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.20.0 - ~/.nvm/versions/node/v16.20.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.20.0/bin/yarn
npm: 8.19.4 - ~/.nvm/versions/node/v16.20.0/bin/npm
Browsers:
Firefox Nightly: 120.0a1
Safari: 16.4
npmPackages:
@rspack/cli: 0.5.4 => 0.5.4
@rspack/core: ^0.5.4 => 0.5.4
@rspack/plugin-react-refresh: 0.5.4 => 0.5.4

Details

version1: not working:
image
image

version2: works fine:
image
image

Reproduce link

No response

Reproduce Steps

  1. Create project as rspack website description:
npm create rspack@latest
  1. update main.tsx and App.tsx like screenshot
  2. run npm run dev
  3. edit App.tsx and save it. Then you can see version1 doesn't work, But version2 works well。

I found a related issue here, But react fast refresh still not work even if my version of react-refresh is [email protected].

Thank you for your help.

@ssehacker ssehacker added bug Something isn't working pending triage The issue/PR is currently untouched. labels Feb 15, 2024
@ssehacker ssehacker changed the title [Bug]: react-fresh not working when i use observer hoc,and works fine if i remove observer or put it inside function component file. [Bug]: react-refreshnot working when i use observer hoc,and works fine if i remove observer or put it inside function component file. Feb 16, 2024
@ssehacker ssehacker changed the title [Bug]: react-refreshnot working when i use observer hoc,and works fine if i remove observer or put it inside function component file. [Bug]: react-refresh not working when i use observer hoc,and works fine if i remove observer or put it inside function component file. Feb 16, 2024
@jerrykingxyz jerrykingxyz removed the pending triage The issue/PR is currently untouched. label Feb 19, 2024
@LingyuCoder
Copy link
Collaborator

LingyuCoder commented Mar 20, 2024

After replacing with webpack, the same issue still exists, and it seems that the component in hot-update.js is being generated correctly.

It appears to be an issue with mobx-react and react refresh. Perhaps need to report this to mobx-react and react-refresh

Copy link

stale bot commented May 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale upstream
Projects
None yet
Development

No branches or pull requests

3 participants