question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HMR not working on import code snippets

See original GitHub issue

Describe the bug

HMR not working on import code snippets

To Reproduce

Steps to reproduce the behavior:

see this video

Expected behavior

auto update code

System Info

  • vitepress version: 0.7.2
  • Node version: v13.14.0
  • OS version: osx 10.15.3

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kiakingcommented, Nov 16, 2020

OK thanks! I’ve confirmed it. I’m not sure if this feature is fully supported yet… 😅 Let’s mark this issue as an enhancement and see if we can make it work.

0reactions
wycatscommented, Nov 30, 2022

Ah, I can see that this problem exists even if an include is added. I was so focused on my use-case that I didn’t notice that the HMR issue exists even if server.addWatchFile is used.

I still think that it would be good to let markdown plugins do custom includes, but perhaps the API needs to be rich enough to support HMR. If there’s interest, I can dig into that 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebPack HMR - run code if HMR server is not found
I got this basic Javascript code which is compiled by webpack. I am using Hot Module Replacement for Styles and Javascript.
Read more >
HMR - NGXS
Hot Module Replacement (HMR) is a Webpack feature to update code in a running app without rebuilding it. This results in faster updates...
Read more >
Hot Module Replacement (HMR) API - Snowpack
Snowpack implements HMR via the esm-hmr spec, an attempted standard for ESM-based ... HMR Code Snippet Example if (undefined /* [snowpack] import.meta.hot ...
Read more >
Vite Hot Module Replacement - A Complete Example
import HotModuleReloadSetup from './HotModuleReloadSetup.js'; // Setup HMR const hmr = new HotModuleReloadSetup(); ...
Read more >
React Snowpack HMR - ReScript Forum
I don't have any problems with getting it working, just interested ... I'm not even sure what that code snippet does, so any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found