SolidJSS
SolidJSโ€ข3y agoโ€ข
2 replies
the_inklink

HMR is not working

I am currently learning SolidJS and am having problems with HMR. I have created a SolidJS project with npm create vite@latest, in which HMR is supposed to work. So far I have manually updated all packages to the latest version and explicitly turned on HMR in the Vite plugin, unsuccessfully. Why could it not work and what can I do?

// package.json

{
  "name": "my-app",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "solid-js": "^1.7.7"
  },
  "devDependencies": {
    "typescript": "^5.1.6",
    "vite": "^4.4.2",
    "vite-plugin-solid": "^2.7.0"
  }
}


// vite-config.ts

import { defineConfig } from 'vite'
import solid from 'vite-plugin-solid'

export default defineConfig({
  plugins: [solid({hot: true})],
})
Was this page helpful?