framework-info icon indicating copy to clipboard operation
framework-info copied to clipboard

fix: changed the Vite port to the new Vite default port 5173

Open nickytonline opened this issue 3 years ago โ€ข 3 comments

๐ŸŽ‰ Thanks for submitting a pull request! ๐ŸŽ‰

Summary

Fixes #791

Vite changed the default port for from 3000 to 5173 on May 31st or around that time. See

https://github.com/vitejs/vite/blob/2826303bd253e20df2746f84f6a7c06cb5cf3d6b/docs/guide/migration.md#dev-server-changes

https://github.com/vitejs/vite/pull/8417

I tested the other vite-based projects: Solid, Svelte Kit, Qwik, and Hydrogen. Qwik and Svelte Kit required the port update as well.


For us to review and ship your PR efficiently, please perform the following steps:

  • [x] Open a bug/issue before writing your code ๐Ÿง‘โ€๐Ÿ’ป. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire ๐Ÿ”ฅ (e.g. incident related), you can skip this step.
  • [x] Read the contribution guidelines ๐Ÿ“–. This ensures your code follows our style guide and passes our tests.
  • [ ] Update or add tests (if any source code was changed or added) ๐Ÿงช
  • [ ] Update or add documentation (if features were changed or added) ๐Ÿ“
  • [x] Make sure the status checks below are successful โœ…

A picture of a cute animal (not mandatory, but encouraged)

nickytonline avatar Jul 22 '22 20:07 nickytonline

I don't think we have a way of handling different versions, do we? Presumably this will cause the reverse problem for older versions of Vite. I guess that's less of a problem because new projects are more likely to use new Vite, but it's worth noting.

ascorbic avatar Jul 22 '22 20:07 ascorbic

I don't think we have a way of handling different versions, do we? Presumably this will cause the reverse problem for older versions of Vite. I guess that's less of a problem because new projects are more likely to use new Vite, but it's worth noting.

@ascorbic, yeah it's a good point. Have we handled something like this in the past? I'm not sure how problematic it will be. We can definitely make support aware of the issue.

Maybe a notice in the CLI of the port upgrade via a new field in the framework info JSON file if it fails via timeout to find the server?

{
  "id": "vite",
  "name": "Vite",
  "category": "build_tool",
  ...
  "dev": {
    "command": "vite",
    "port": 5173,
    "pollingStrategies": [{ "name": "TCP" }]
	"migrationMessage": "Vite's default port is now 5173. See the migration guide https://vitejs.dev/guide/migration.html#architecture-changes-and-legacy-options"
  },
  ...
}

We could also check for both ports, but that seems more of bandaid solution.

nickytonline avatar Jul 22 '22 21:07 nickytonline

There is an env var field available, so maybe we can use one to force the old version to use the new port number (or vice versa). Worth a try.

ascorbic avatar Jul 22 '22 21:07 ascorbic

Deploy Preview for framework-info ready!

Name Link
Latest commit f7a8132aba43d5135ea6ecb5209240f257b55b90
Latest deploy log https://app.netlify.com/sites/framework-info/deploys/634eb8a4fe9356000977372b
Deploy Preview https://deploy-preview-792--framework-info.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Oct 18 '22 14:10 netlify[bot]