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.

Breaking change in 2.9: listening server on server.hmr.port

See original GitHub issue

Describe the bug

We have a bit of a special setup: instead of Vite proxying our server, we proxy to Vite via our server. We do this using a config that has a section looking like this:

  server: {
    port: 5588,
    hmr: {
      port: 3001,
    },
  },

This makes the in-app Vite client contact a server on port 3001, and this has been working fine up until now. But with the 2.9 upgrade, suddenly Vite itself started a listening IPv6 port on server.port. This is new, and conflicts with our setup. I am not sure of a workaround.

Reproduction

https://github.com/fatso83/issue-reproductions/tree/master/vite-2.9-server.hmr.port

System Info

System:
    OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
    CPU: (12) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 18.41 GB / 31.32 GB
    Container: Yes
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 16.14.0 - /usr/local/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 8.3.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 100.0.4896.60
    Firefox: 98.0.2
  npmPackages:
    @vitejs/plugin-react: ^1.3.0 => 1.3.0 
    vite: 2.9 => 2.9.1

Used Package Manager

pnpm

Logs

No response

Validations

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
patak-devcommented, Apr 5, 2022

Oh, sorry @fatso83, we updated an env dir change in the changelog and got these mixed up 👀 I agree with you, this should be documented in the Changelog and in the hmr.port config. Let’s talk in #7545 and do it once it is clear that this is what is expected

1reaction
txbspgycommented, Apr 5, 2022

来自#7545的解决方法。这是一个无证的重大变化还是一个意外的回归?

导出 默认 defineConfig ({
  服务器:{ 
    hmr:{  clientPort:443  } ,
    主机:“0.0.0.0” ,
    打开:false ,
    端口:80 ,
    strictPort:true ,
  } ,
} );

谢谢谢谢,对我有帮助

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog | Meteor API Docs
Fix issues with HMR and meteor build --debug PR ... Changes to keep everything compatible with MongoDB Server 5.x and MongoDB Node.js driver...
Read more >
Server Options | Vite (main branch)
Specify which IP addresses the server should listen on. ... Note if the port is already being used, Vite will automatically try the...
Read more >
oiO - River Thames Conditions - Environment Agency - GOV.UK
Tsp problem, 20611 rvu, Century break snooker 2012, Aadhaar based ... 2014 mercedes benz s65 amg 4matic, Teamspeak server cost, Strada frosa sarandy...
Read more >
How To Setup Your React Project With ESBuild From Scratch
#!/bin/bash node esbuild.js; # Expected Output: # Listening on port: 3000 ... dist -p 8000; # Expected Output: # Starting up http-server, serving...
Read more >
Release Notes - Nuxt
server. #8593 Fix HMR issue with serverMiddleware when router.base is set. babel. #8545 Enable polyfilling of proposal core-js features.
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