Skip to content

Reactotron fails silently when port 9090 is already in use #1334

@jamonholmgren

Description

@jamonholmgren

Problem

I tried running a Reactotron 2.8.1 instance and a Reactotron 3.0.0-beta.39 instance next to each other.

Two Reactotron instances

Whichever order I open them in, the first one "wins", and the second one just fails silently.

So, to test this conflict, I ran this one-liner to start a new websocket server:

node -e "const http = require('http'); const WebSocket = require('ws'); const server = http.createServer((req, res) => { res.end('HTTP Server Running'); }); const wss = new WebSocket.Server({ server }); wss.on('connection', ws => { ws.on('message', message => { console.log('received: %s', message); }); console.log('WebSocket client connected'); }); server.listen(9090); console.log('HTTP and WebSocket server running on port 9090');"

Sure enough, starting Reactotron 2 or 3 up resulted in them failing silently. Instead, the websocket server would log all of the Reactotron communication attempts:

websocket server

Proposed Solution

I think we should detect when the websocket server fails to start due to a port conflict and display a UI that says "Port 9090 appears to already be in use. [Retry button]".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Nope, this is wrong.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions