vite-plugin-solid icon indicating copy to clipboard operation
vite-plugin-solid copied to clipboard

[vite] server connection lost. Polling for restart...

Open bitnom opened this issue 1 year ago • 1 comments

Doing a crash course in solid by porting a site to solidstart. I know very little about any of these frameworks. I went with the solidstart guide and used that to create a dev container. I also installed the solid browser extension. Everything seems okay until I check the browser console:

[vite] server connection lost. Polling for restart...
client:732 GET http://localhost:42093/_build/ net::ERR_CONNECTION_REFUSED client:732

The port number logged to console is always random regardless of what I set in vite.config.js:

import { defineConfig } from 'vite'
import solid from 'vite-plugin-solid' // or solid-start/vite
import devtools from 'solid-devtools/vite'

export default defineConfig({
  server: {
    strictPort: true,
    host: "127.0.0.1",
    port: 3002,
    hmr: {
      // host: "127.0.0.1",
      port: 3002,
      // clientPort: 3002,
    },
  },
  plugins: [
    devtools({
      /* features options - all disabled by default */
      locator: {
        targetIDE: 'vscode',
        componentLocation: true,
        jsxLocation: true,
      },
      autoname: true, // e.g. enable autoname
    }),
    solid({
      // currently HMR breaks displaying components
      // https://github.com/solidjs/solid-refresh/pull/41 will fix this
      hot: false,
    }),
  ],
})

The two ports actually open are 3000 (main) and 3001 (For the browser extension). Both are exposed on the host and the extension is able to connect.

package.json:

{
"dependencies": {
    "@solidjs/router": "^0.14.1",
    "@solidjs/start": "^1.0.5",
    "autoprefixer": "^10.4.19",
    "postcss": "^8.4.38",
    "solid-js": "^1.8.18",
    "tailwindcss": "^3.4.3",
    "vinxi": "^0.4.0"
  },
  "engines": {
    "node": ">=18"
  },
  "volta": {
    "node": "22.4.1"
  },
  "devDependencies": {
    "solid-devtools": "^0.30.1"
  }
}

potentially related to: https://github.com/vitejs/vite/issues/4259

bitnom avatar Jul 17 '24 04:07 bitnom