-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
padLevels warning appears in Winston@3 #1882
Comments
I'm seeing this issue too on Node 14.15.5 |
Also getting this issue... any suggestions out there? |
Any workarounds for this? |
Yeah, switch to Pino :( |
Any solution for this issue? |
I can't reproduce the warning in a clean project where only [email protected] is installed, so the error is not in winston@3 itself. Also, winston@2 under node 14 does not trigger this warning either. However, I can reproduce this error in a project where BOTH winston@2 AND winston@3 are included via different dependencies. 'padLevels' was removed from winston@3. So I think the underlying issue could be conflicting versions of winston in your dependencies (or dependencies' dependencies). |
We also get this in [email protected]. This patch suppresses the warning: diff --git a/node_modules/winston/lib/winston/common.js b/node_modules/winston/lib/winston/common.js
index 8ed9973..53cf4cd 100644
--- a/node_modules/winston/lib/winston/common.js
+++ b/node_modules/winston/lib/winston/common.js
@@ -32,7 +32,7 @@ exports.setLevels = function (target, past, current, isDefault) {
}
target.levels = current || config.npm.levels;
- if (target.padLevels) {
+ if (target.hasOwnProperty('padLevels') && target.padLevels) {
target.levelLength = exports.longestElement(Object.keys(target.levels));
}
|
I can confirm that this happened with [email protected] but is fixed with [email protected] |
Please tell us about your environment:
winston
version?winston@2
winston@3
node -v
outputs: v14.13.1What is the problem?
padLevels warning ("Accessing non-existent property 'padLevels' of module exports inside circular dependency") appears when using Winston 3.3.3. Issue has been mostly related to Winston@2
What do you expect to happen instead?
padLevels does not occur
Other information
Logger is created as so
A line such as
logger.info("NPM package " + viewEngineData.expressName + " installed")
will cause the warning.unsure if my Winston setup is wrong but seem to be using only Winston3 functions
The text was updated successfully, but these errors were encountered: