signals
signals copied to clipboard
Vite HMR not working
HMR is not triggered on file changes when using @preact/signals-react
Vite does seem to detect the code changed as the console line keeping count of changes does increase:
8:27:13 PM [vite] hmr update /src/App.tsx (x35)
However, the changes in code / UI do not get updated.
As soon as I switch back to react's useState it starts working again.
package.json
{
"name": "test",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@preact/signals-react": "^1.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react-swc": "^3.0.0",
"typescript": "^4.9.3",
"vite": "^4.2.0"
}
}
Happens with webpack HMR as well
Duplicate of #250