Repository navigation
Don't crash Metro when the Rozenite panel port 8071 is already in use - #29
Merged
Merged
Conversation
retyui
reviewed
Oct 13, 2026
retyui
requested changes
Oct 13, 2026
retyui
left a comment
Owner
There was a problem hiding this comment.
thank you for PR , left small comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #28.
With two Metro servers running at once (we run one per git worktree), the second one crashed on start because the Rozenite panel server always listens on 8071 and nothing handled the
'error'event fromlisten().So
runServer()now handles that event: onEADDRINUSEit prints a warning and Metro keeps running without its own panel server. Any other listen error gets a warning too, and a rejectedcreateServer()no longer turns into an unhandled rejection.I tested the built plugin with 8071 held by a running Metro: it returned the config, printed the warning, and the process was still alive 8 seconds later. Before the change the same setup exited in about a second.
yarn biome check,typecheckandbuildpass for the package, and there's a patch changeset.The port itself stays hard-coded, because
public/index.htmlpoints its iframe athttp://localhost:8071. Making it configurable would mean telling the panel the port, which felt like a separate change. I put the port in aSERVER_PORTconstant with a note aboutindex.htmlso the two stay in sync.