solidjs / templates

Vite + solid templates
440 stars 119 forks source link

`solid-refresh` HMR doesn't work properly for the JS template #30

Open lxsmnsyc opened 2 years ago

lxsmnsyc commented 2 years ago

This is a very weird case I believe, only the JS template has its HMR completely bugged. Compilation is correct for both babel-preset-solid and solid-refresh, the replacement module actually gets loaded (at least on Vite's client) however it seems that it doesn't send the replacement module to the module accept part (I have not tested this fully yet, but it might be the case). The bug is that even if the HMR update goes through, the component does not get replaced.

If anyone can reproduce this on other bundler setup, the issue might be on solid-refresh' side. If this only happens on Vite, the issue might be either on Vite or the plugin.

electroheadfx commented 2 years ago

I have exactely the same issue for js template , thanks. add / @refresh reload / in frontmatter file seem to solve the issue per file.

ff2400t commented 2 years ago

I have the same issue , but the ts-windicss template has worked for me 🤔

lxsmnsyc commented 2 years ago

I have the same issue , but the ts-windicss template has worked for me 🤔

yeah it seems that only the JS template is broken, the other template works perfectly fine, I'm not entirely sure why

linorabolini commented 1 year ago

I have the same problem. The hot reloading, depending on what update to the code is made, may or may not break the page, so I end up needing to reload the entire page anyways.