Skip to content

Conversation

@KJ7LNW
Copy link
Contributor

@KJ7LNW KJ7LNW commented Apr 6, 2025

Context

This PR implements a solution for the Vite port collision issue that allows easier development of Roo across multiple instances of VSCode in different Roo repository directories.

This may also fix crashes and strange behavior between multiple running instances that would otherwise create port conflicts.

Implementation

The solution uses a fully automated process:

  • When Vite automatically selects an alternative port, a custom plugin automatically writes the port to a '.vite-port' file in the repository root
  • ClineProvider automatically reads the port from this file, falling back gracefully to port 5173 if the file doesn't exist
  • No user intervention is necessary as the entire process is handled automatically
  • Added detailed logging for debugging
  • Added .vite-port to .gitignore

How to Test

  1. Run multiple instances of VSCode with different Roo repositories
  2. Press F5 in each instance to run Roo in the VS Code extension development host
  3. Verify that each instance connects to its own Vite server, even when they use different ports

Get in Touch

Discord: KJ7LNW


Important

Implements dynamic Vite port detection to avoid port collisions by writing and reading the port from a .vite-port file, with changes in ClineProvider.ts and vite.config.ts.

  • Behavior:
    • Implements dynamic Vite port detection to avoid port collisions in ClineProvider.ts and vite.config.ts.
    • Writes selected Vite port to .vite-port file using a custom plugin in vite.config.ts.
    • Reads Vite port from .vite-port file in getHMRHtmlContent() in ClineProvider.ts, defaults to 5173 if file is missing.
  • Logging:
    • Adds logging for port usage and errors in both ClineProvider.ts and vite.config.ts.
  • Misc:
    • Adds .vite-port to .gitignore.

This description was created by Ellipsis for 0a3ba71. It will automatically update as commits are pushed.

Implements a solution for the Vite port collision issue that allows easier development of Roo across multiple instances of VSCode in different Roo repository directories.

This may also fix crashes and strange behavior between multiple running instances that would otherwise create port conflicts. This is solved using the following automated process:
- When Vite automatically selects an alternative port, a custom plugin automatically writes the port to a '.vite-port' file in the repository root
- ClineProvider automatically reads the port from this file, falling back gracefully to port 5173 if the file doesn't exist
- No user intervention is necessary as the entire process is handled automatically
- Added detailed logging for debugging
- Added .vite-port to .gitignore

The extension now connects to the correct Vite development server port automatically, even when the default port (5173) is already in use.

Signed-off-by: Eric Wheeler <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Apr 6, 2025

⚠️ No Changeset found

Latest commit: 0a3ba71

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Apr 6, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 6, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 7, 2025
@mrubens mrubens merged commit af9e471 into RooCodeInc:main Apr 7, 2025
19 checks passed
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Apr 7, 2025
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
* Add saito-sv as CodeOwner

* Create tricky-glasses-cheer.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants