-
Notifications
You must be signed in to change notification settings - Fork 9
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
has-flag.js - seems to assume cli use, causing issue during synchronous module loading #41
Comments
I was just dealing with a similar issue. In our case, we have a pretty generic Next app. We've decided to add For now, I've moved logging code out of middleware. If I initialize the logger anywhere in server-side |
I just had the same issue with Next 13 using app directory. As stated by @valueof, running winston logger inside middleware breaks. I've also moved my logger out for now. |
Ran into the same issue using Next 13 (middleware + app directory). Was able to fix it locally using yarn patch, applying the same minor change as in PR #44. |
This has been closed and released in v1.6.0. Thanks all! |
The issue looks to be here:
https://github.com/DABH/colors.js/blob/master/lib/system/has-flag.js#L28
Node is just loading all imports into memory like it always does, and an error shows up:
Some debugging ahead of time will show that neither argv nor process.argv are defined.
Looking for any suggestions as to what can cause this. As the dependency chain comes from winston, I would image you would be seeing more issues raised if it was a straight up bug. Thank you
The text was updated successfully, but these errors were encountered: