Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bitnom opened this issue Jul 17, 2024 · 0 comments
Open

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

bitnom opened this issue Jul 17, 2024 · 0 comments

Comments

@bitnom
Copy link

bitnom commented Jul 17, 2024

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: vitejs/vite#4259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant