Skip to content

> > @pzmosquito can you please share your full config? #2034

@carlos2martinize

Description

@carlos2martinize

@pzmosquito can you please share your full config?
I've managed to get this to not reload. The WS never connects, but at least it doesn't reload and I can use non-built/non-minified JS/TS(x) files.

server: {
    // host: '0.0.0.0',
    // https: true,
    hmr: {
      host: 'ad345ds2.ngrok.io',
      // port: 443,
      // protocol: 'wss',
    },
  },

Uncommenting https or port makes Vite enter the endless reloading loop.
PS I'm using ngrok tunnel.

import path from "path";
import { defineConfig } from "vite";
import reactRefresh from "@vitejs/plugin-react-refresh";

export default defineConfig({
    mode: "development",
    resolve: {
        alias: {
            _: path.resolve(__dirname, "src"),
        },
    },
    plugins: [
        reactRefresh(),
    ],
    clearScreen: false,
    server: {
        host: "0.0.0.0",
        port: 3000,
        strictPort: true,
        hmr: {
            port: 443,
        },
    },
});

need to set strictPort=true, thanks a lot

Originally posted by @blakeyi in vitejs/vite#4259 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions