bfanger / tvkit

Proxy to run a modern dev server in old browsers
MIT License
22 stars 5 forks source link

Error occurred while proxying request localhost:3000/ to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors) #13

Closed herzorf closed 8 months ago

herzorf commented 1 year ago

when i started my dev server and i run npx tvkit@latest serve --browser "ie 11" in other window i got error

λ npx tvkit@latest serve --browser "ie 11"
Need to install the following packages:
  tvkit@0.12.0
Ok to proceed? (y) y
[tvkit] {
  port: 3000,
  target: 'http://localhost:5173',
  browsers: [ 'ie 11' ],
  supports: {},
  css: true,
  ssl: false
}
[HPM] Proxy created: /  -> http://localhost:5173
[tvkit] Running on http://localhost:3000/
[HPM] Error occurred while proxying request localhost:3000/ to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while proxying request localhost:3000/favicon.ico to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while proxying request localhost:3000/ to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while proxying request localhost:3000/favicon.ico to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while proxying request localhost:3000/ to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while proxying request localhost:3000/favicon.ico to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
[HPM] Error occurred while proxying request localhost:3000/ to http://localhost:5173/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)

this is my vite.config.json

import { build, defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import legacy from '@vitejs/plugin-legacy'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    legacy({
      targets: ['ie <= 11'],
      additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
    }),
  ],
  css: {
    modules: {
      localsConvention: 'camelCase'
    }
  },
  server: {
    host: '0.0.0.0'
  },
  resolve: {
    alias: {
      '@': '/src'
    }
  },
  base: "/GANW/dist/"
})
bfanger commented 1 year ago

The error message indicates that no webserver was available on http://localhost:5173/
You probably didn't start the vite server, or it crashed.

Browser to http://localhost:5173/ to verify the server is running, it it is not, there is nothing the tvkit proxy can do.