-
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
[Bug]: Winston failed to execute caused by TypeError #2327
Comments
Important notice: |
@adampweb what version of colors are you picking up? I thought I fixed that colors issue in colors 1.6.0; maybe Winston needs to bump its dependency version? If so, please open a PR; if not, please consider opening a PR on colors? Thanks! |
The latest version of winston still uses v1.5.0 of @colors/colors. But another dependency (logform) of winston also uses this version: client@0.1.0 /path/of/my/project
└─┬ winston@3.10.0
├── @colors/colors@1.5.0
└─┬ logform@2.4.0
└── @colors/colors@1.5.0 deduped |
Ah, ok. If you open some PRs to bump the dependencies, I can merge and publish new versions, so then you should be good to go. Thanks |
Issue represented here: winstonjs/winston#2327
Issue represented here: winstonjs#2327
Any idea when this will be released? I cannot figure how to work around 1.5.0 and continue to see the error. |
Please consider re-opening #2328. At least we will know if there are still issues on 1.6.0, and can then narrow down to some other potential issue. |
Aggre
Just started using Winston and I am seeing issues with @colors/colors for version 1.6.0 |
is still in |
This is happenning to me as well |
Yeah, I have the same problem... |
I'm still having this issue after upgrading to Winston 3.11 |
The same problem with |
Until winstonjs/logform#272 is merged & released you can work around the issue by using overrides in your package.json: "overrides": {
"@colors/colors": "1.6.0"
}, Note though that this doesn't fix the Winston + Next.js 13 app router issue since Winston uses winston/lib/winston/exception-handler.js Line 199 in a7c2eec
which is not allowed in Next.js middleware: vercel/next.js#46722 (comment) |
🔎 Search Terms
winston colors, winston docker container fails,
The problem
Winston version: ^3.10.0
NodeJS version: v18.16.1
NPM version: 9.5.1
NextJS version: 13.4.10
Winston brakes the app (NextJS 13) because of an unhandled Exception in peer dependency (@colors/colors):
The error message reflects a TypeError in https://github.com/DABH/colors.js/blob/master/lib/system/has-flag.js file. Not checks the argv variable is not undefined.
What version of Winston presents the issue?
3.10.0
What version of Node are you using?
v18.16.11
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
1. Fresh install NextJS with Tailwind CSS
2. Install the latest version of Winston
3. Make a logger instance in
src/services/logger.ts
file4. Create NextJS middleware in
src/middleware.ts
file5. Start the app
After that the error (which is detailed above) has appeared in the console and the browser.
Additional configs
package.json
tsconfig.json
Not modified manually, generated by
npx create-next-app
next.config.js
Not modified manually, generated by
npx create-next-app
Directory structure and permissions
drwxrwxr-x 7 adam adam 4,0K júl 16 14:16 . drwxr-xr-x 8 adam adam 4,0K júl 16 14:12 .. drwxrwxr-x 8 adam adam 4,0K júl 16 14:13 .git -rw-rw-r-- 1 adam adam 368 júl 16 14:11 .gitignore drwxrwxr-x 6 adam adam 4,0K júl 16 14:47 .next -rw-rw-r-- 1 adam adam 92 júl 16 14:11 next.config.js -rw-rw-r-- 1 adam adam 201 júl 16 14:11 next-env.d.ts drwxrwxr-x 133 adam adam 4,0K júl 16 14:17 node_modules -rw-rw-r-- 1 adam adam 514 júl 16 14:17 package.json -rw-rw-r-- 1 adam adam 63K júl 16 14:17 package-lock.json -rw-rw-r-- 1 adam adam 82 júl 16 14:11 postcss.config.js drwxrwxr-x 2 adam adam 4,0K júl 16 14:12 public -rw-rw-r-- 1 adam adam 1,4K júl 16 14:11 README.md drwxrwxr-x 4 adam adam 4,0K júl 16 14:24 src -rw-rw-r-- 1 adam adam 480 júl 16 14:12 tailwind.config.js -rw-rw-r-- 1 adam adam 642 júl 16 14:12 tsconfig.json
Additional information
No response
The text was updated successfully, but these errors were encountered: