Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pinging the server when it listens on 0.0.0.0 and the user provided the port number #357

Merged
merged 12 commits into from Feb 26, 2023

Conversation

bahmutov
Copy link
Owner

@bahmutov bahmutov commented Feb 24, 2023

Replace assuming the port XXXX refers to localhost:XXXX and instead use 127.0.0.1:XXXX

@bahmutov
Copy link
Owner Author

@MikeMcC399 what do you think about this solution? I wish I could try pinging both localhost:XXXX and 127.0.0.1:XXXX alternatively but since we rely on wait-on, we cannot do this. I am also thinking this should be a "minor" version bump.

@bahmutov bahmutov changed the title Test server with 0.0.0.0 host Fix pinging the server when it listens on 0.0.0.0 and the user provided the port number Feb 24, 2023
@MikeMcC399
Copy link

@bahmutov

@bahmutov
Copy link
Owner Author

bahmutov commented Feb 26, 2023 via email

@bahmutov
Copy link
Owner Author

bahmutov commented Feb 26, 2023 via email

@bahmutov bahmutov merged commit 9df0423 into master Feb 26, 2023
10 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.15.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sodatea
Copy link

sodatea commented Feb 27, 2023

Thanks for your work on this project!

But FYI I believe this release breaks the Cypress template of create-vue:
https://github.com/vuejs/create-vue/actions/runs/4277827772/jobs/7448606700#step:14:22

It looks like a breaking change to me.

I relied on the documented behavior that :4173 resolves to localhost:4173, and intentionally removed the host prefix after Vite changed its default from 127.0.0.1 to localhost. I expect this to continue working without a major release.

@sodatea
Copy link

sodatea commented Feb 27, 2023

As for the Node.js 17+ and 0.0.0.0 issues, there's an explanation in the Vite documentation:
https://vitejs.dev/config/server-options.html#server-host

In Vite, we choose to default to localhost for the least surprise, and warn the users when their configuration might be problematic.

@MikeMcC399
Copy link

Since this appears to be a breaking change, it would need to be reverted, as breaking changes require the release of a new major version.

@MikeMcC399
Copy link

MikeMcC399 commented Feb 27, 2023

@bahmutov

How can I revert a release provides advice about what to do if a release accidently includes a breaking change.

Edit: It looks like 1.15.5 has been withdrawn from https://www.npmjs.com/package/start-server-and-test?activeTab=versions

@bahmutov
Copy link
Owner Author

bahmutov commented Feb 27, 2023 via email

@sodatea
Copy link

sodatea commented Feb 28, 2023

I deprecated that npm dist tag

1.x or ^1.0.0 still resolves to 1.5.5 according to https://semver.npmjs.com/

@bahmutov
Copy link
Owner Author

bahmutov commented Feb 28, 2023 via email

sodatea added a commit to vuejs/create-vue that referenced this pull request Feb 28, 2023
A breaking change was introduced in start-server-and-test 1.5.5
and now :4173 is not equivalent to localhost:4173, which Vite uses by
default, so we have to use the full url in the command.

bahmutov/start-server-and-test#357 (comment)
@MikeMcC399
Copy link

@sodatea

I deprecated that npm dist tag

1.x or ^1.0.0 still resolves to 1.5.5 according to https://semver.npmjs.com/

I don't think what you are seeing is contradictory. See https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions. npm install disregards the deprecated version 1.5.5. I suspect if you let renovate run again it will not try to update to 1.5.5.

$ npm install start-server-and-test@1.x

changed 1 package, and audited 1605 packages in 3s

247 packages are looking for funding
  run `npm fund` for details

6 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

$ npm ls start-server-and-test
react-app-test@0.1.0 
└── start-server-and-test@1.15.4


@sodatea
Copy link

sodatea commented Feb 28, 2023

npm install disregards the deprecated version 1.5.5.

😮 I didn't know that. Nice feature!
Thank you for pointing this out to me!

smart-dev2016 added a commit to smart-dev2016/create-vue that referenced this pull request Apr 12, 2023
A breaking change was introduced in start-server-and-test 1.5.5
and now :4173 is not equivalent to localhost:4173, which Vite uses by
default, so we have to use the full url in the command.

bahmutov/start-server-and-test#357 (comment)
jasonreyes9 added a commit to jasonreyes9/create-vue-script that referenced this pull request Oct 31, 2023
A breaking change was introduced in start-server-and-test 1.5.5
and now :4173 is not equivalent to localhost:4173, which Vite uses by
default, so we have to use the full url in the command.

bahmutov/start-server-and-test#357 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants