question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.9.1 `portsAreCompatible` is a breaking change

See original GitHub issue

Describe the bug

https://github.com/vitejs/vite/blob/c7fc7c34029f109bb716c6a2888022b2f4c40e3d/packages/vite/src/node/server/ws.ts#L35

When access dev server from domain(www.mydomain.com) not localhost:xxxx, websocket always connect failed.

And It works in v2.8.6

my vite config


  server: {
        hmr: {
            port: 80,
        },
    },

I highly recommended Revert this PR https://github.com/vitejs/vite/pull/7282

Reproduction

Critical bug

System Info

System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 113.89 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.14.0/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm

Used Package Manager

yarn

Logs

No response

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
lbogdancommented, Apr 8, 2022

Completely agree! I also think a documentation section describing how HMR works, the list of setups supported out of the box, and the required configuration for more esoteric setups might also help a lot of people.

3reactions
gudleikcommented, Mar 31, 2022

Experienced same issue after updating from 2.8.6 to 2.9.1. We run vite apps on Docker in Kubernetes and Tilt.dev. Vite runs on 8080, while the ingress listens on 80, and we use http://lvh.me to access the app.

Solved it by setting port to 8080 and clientPort to 80.

diff --git i/app/auth/vite.config.ts w/app/auth/vite.config.ts
index c312415b3..1b343e297 100644
--- i/app/auth/vite.config.ts
+++ w/app/auth/vite.config.ts
@@ -13,7 +13,8 @@ export default defineConfig({
   },
   server: {
     hmr: {
-      port: Number(process.env.VITE_HMR_PORT),
+      clientPort: Number(process.env.VITE_HMR_PORT),
+      port: 8080,
     },
   },
   resolve: {
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading Linkerd
There are two breaking changes in the 2.11.0 release: pods in ingress no longer support non-HTTP traffic to meshed workloads; and the proxy...
Read more >
VMware Tanzu Application Service for VMs v2.9 Release Notes
This causes a breaking change if you use Tanzu GemFire for VMs v1.12 or ... The stemcell in this patch is not compatible...
Read more >
Release notes & updates – Azure CLI - Microsoft Learn
Learn about the latest Azure Command-Line Interface (CLI) release notes and updates for both the current and beta versions of the CLI.
Read more >
Chapter 2. Major Changes and Migration Considerations
systemd is designed to be largely compatible with SysV in terms of user experience ... inst.virtiolog: Specifies a virtio port to be used...
Read more >
Ansible 2.10 Porting Guide
This section discusses the behavioral changes between Ansible 2.9 and Ansible ... compatible to the docker command line utility: a one-port container range ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found