Open
Conversation
- Swap chalk v4 for picocolors (14x smaller, zero dependencies) - Fix ReferenceError: colors is not defined (lines 115-118) The nopanic error handler referenced `colors` instead of the imported `chalk` variable, causing a crash on fatal errors - Fix TypeError: logger.warning is not a function (line 233) The websocket proxy warning used `logger.warning()` which does not exist on the logger object; changed to `logger.info()` Addresses http-party#949 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
chalk(v4, 5 transitive deps) withpicocolors(v1, zero deps)ReferenceError: colors is not definedin the--no-panicerror handlerTypeError: logger.warning is not a functionin the WebSocket proxy checkChanges
bin/http-server
require('chalk')→require('picocolors')colorsvariable references (lines 115-118) that caused crashesin the
--no-panicerror handler —colorswas never imported, should havebeen
chalk(nowpc)logger.warning()call — the logger object has no.warning()method;changed to
logger.info()which is the available output methodpackage.json
chalk^4.1.2picocolors^1.1.1All color methods used (
red,cyan,yellow,green,magenta,bold)have exact equivalents in picocolors. Both libraries respect
NO_COLORandFORCE_COLORenvironment variables.Testing
Addresses #949