Skip to content

Conversation

@HarshVz
Copy link

@HarshVz HarshVz commented Jan 29, 2026

fix: resolve colors undefined and logger.warning errors in CLI

This PR fixes two critical issues in the bin/http-server
CLI that caused crashes when using the --websocket flag or when encountering fatal errors with --no-panic:

  • Fixed ReferenceError: colors is not defined: The codebase uses chalk for terminal styling, but several locations were incorrectly referencing a colors variable that was never imported. All instances have been updated to use chalk.
  • Fixed TypeError: logger.warning is not a function: The logger object used for CLI output was missing a warning method. This caused a crash when the server tried to warn the user that WebSocket proxying requires a proxy target. I have added warning: console.warn to the logger definition.
Relevant issues

fixes #949

Contributor checklist
  • Provide tests for the changes (unless documentation-only)
  • Documented any new features, CLI switches, etc. (if applicable)
    • Server --help output
    • README.md
    • doc/http-server.1 (use the same format as other entries)
  • The pull request is being made against the master branch
Maintainer checklist
  • Assign a version triage tag
  • Approve tests if applicable

@HarshVz HarshVz changed the title FIX: colors not defined and logger warning not a function fix: resolve colors undefined and logger.warning errors in CLI Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReferenceError: colors and logger warning are not defined when using --websocket flag

1 participant