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

热更新的不生效问题 #164

Open
one-god opened this issue May 10, 2024 · 1 comment
Open

热更新的不生效问题 #164

one-god opened this issue May 10, 2024 · 1 comment

Comments

@one-god
Copy link

one-god commented May 10, 2024

image
有点不懂,一样的目录层级也一样,一个是page reload 一个hmr update,而且大部分都是hmr update,不会去更新页面,
有人知道什么问题吗

Copy link

dosubot bot commented May 10, 2024

To address the issue where Hot Module Replacement (HMR) updates are not taking effect as expected, consider the following potential causes and solutions:

  1. Check Your Debounce Utility: Ensure the debounce utility's configuration isn't delaying or preventing HMR updates. Adjust the debounce timing if necessary.

  2. Review Direct DOM Manipulation: If your code manipulates the DOM directly, it might interfere with HMR. HMR works best with JavaScript modules, so changes to the DOM might not be automatically updated with module replacement.

  3. State Management Considerations: If your application's state is managed externally (e.g., Vuex, local storage), remember that HMR doesn't automatically reflect state changes. State management practices might need adjustment to work seamlessly with HMR.

  4. Vite Configuration: Verify your vite.config.js for any configurations that might disable HMR, specifically the server.hmr option. Ensure it's correctly set to enable HMR.

  5. Dependencies or Plugins: Some dependencies or plugins could interfere with HMR. Review the ones you're using for any known issues related to HMR.

  6. Check for Known Issues: Look into the release notes and GitHub issues for Vue and Vite for any known HMR-related issues with the versions you're using.

For a more precise diagnosis, additional details about your project structure, how handleWindowResize is integrated, and any console errors or warnings when HMR fails would be helpful.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

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

1 participant