Skip to content

a problem related to the vite server port #5241

@classmatewu

Description

@classmatewu

Describe the bug

  1. a new vite app: default port is 3000
    image

  2. my koa server: this port is also 3000
    image

when I start vite app and then start koa server OR start koa server and then start vite app, no indication of port conflict.

And I use Google Chrome to access the page 127.0.0.1:3000, the page display content about the latter server content.

Reproduction

This question reminds me of PM2——master-slave mode, but vite didn't handle it well. I try to read the vite's source code, but I am worried about misunderstanding, so come here to issue. If this is a problem, can you provide solutions or fix it as soon as possible?

thanks.

System Info

@vite:   2.6.4,
@node:   14.16.0,
@koa:    2.13.3,
@Google: Chrome: 94.0.4606.71 (official version) (x86_64),
@OS: 	 macOS Catalina 10.15.7,
@JavaScript:	V8 9.4.146.18,

Used Package Manager

npm

Logs

null

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions