Vue HMR only works for changing to existing DOM nodes, doesn't update when node added/removed

121 Views Asked by At

I've been using the included Hot Reload in Vue since starting a project, but it has randomly stopped working. At the moment, changing to existing nodes work (e.g. adding/removing a class, updating text), but adding or removing a node doesn't rerender.

After watching the WS connection, I can see the update hash is received every time, and the script is loaded successfully. Setting a breakpoint on webpackHotUpdate shows it executes normally every time.

If a node is added or removed, forcing a re-render (changing page/tab/resizing the browser) causes it to show successfully, suggesting the issue could be some kind of module cache?

I'm lost here, and don't know enough about Vue internals to track it down. Any ideas?

0

There are 0 best solutions below