Skip to content

UI stuck on Reconnecting after npm run dev - no auth URL printed at startup #37

@thereseseldon

Description

@thereseseldon

Description

After cloning and running npm run dev, both the Vite client (port 5173) and Express server (port 3001) start successfully. However, when opening http://localhost:5173/ in the browser, the UI gets stuck on "Reconnecting..." and never connects.

Environment

  • OS: macOS 14.6.1 (Sonoma), Apple Silicon
  • Node: v25.2.1
  • npm: 11.6.2
  • Branch: fix/default-font-cross-platform (commit 0d0229a)
  • freshell version: 0.1.0

Steps to Reproduce

  1. git clone https://github.com/danshapiro/freshell.git
  2. cd freshell && npm install
  3. npm run dev
  4. Open http://localhost:5173/ in browser
  5. UI shows "Reconnecting..." spinner indefinitely

Server Logs

Server starts cleanly with no errors:

[server] INFO: Security: AUTH_TOKEN configured (48 chars)
[server] DEBUG: Loaded config
[server]     configPath: "~/.freshell/config.json"
[server] INFO: Starting Claude sessions watcher
[server] INFO: Server listening
[server]     port: 3001

No WebSocket connection attempts appear in the server log.

Likely Cause

The .env file is auto-generated with an AUTH_TOKEN, and the WebSocket handshake requires it via ?token=... in the URL. However, the npm run dev startup output only shows http://localhost:5173/ (from Vite) — it never prints the token-authenticated URL. So visiting the plain URL means:

  1. No token in sessionStorage
  2. Client sends { type: 'hello', token: undefined } over WebSocket
  3. Server rejects with NOT_AUTHENTICATED (close code 4001)
  4. UI shows "Reconnecting..."

Suggestion

The server startup log should print the full authenticated URL, e.g.:

Server listening on http://localhost:5173/?token=<AUTH_TOKEN>

This would match the README description: "The startup console displays a URL for browser access."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions