0

So I'm using Vite with React, and working fine until this morning. When I run npm run dev local server starts normally, and there is no error/warning in the console. However in the browser console, I see this warning,

Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled.

and hot reload is not working. Whenever I change something I have to manually refresh the browser window to see the changes. Any help?

my package.json file:

 {
  "name": "test",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "@capacitor/android": "^4.6.3",
    "@capacitor/browser": "^4.1.1",
    "@capacitor/core": "^4.6.3",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.8.1"
  },
  "devDependencies": {
    "@capacitor/cli": "^4.6.3",
    "@types/react": "^18.0.27",
    "@types/react-dom": "^18.0.10",
    "@vitejs/plugin-react": "^3.1.0",
    "autoprefixer": "^10.4.13",
    "postcss": "^8.4.21",
    "tailwindcss": "^3.2.6",
    "vite": "^4.1.0"
  }
}
Saif71
  • 487
  • 1
  • 5
  • 14

1 Answers1

1

I had the same problem, turns out it was AdGuard filtering localhost. You can turn off this setting. Settings → General Settings → Advanced settings and uncheck the Filter localhost