-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Show error info for --require param problem #176
Conversation
Can you update the tests and check why appveyor is failing? |
I've seen and check in my local machine. All tests pass also on TravisCI. Only on Appveyor not and it's looks that something is broken there. |
I met the same error recently. This cause seems that timestamps in log outputs were not erased because of ANSI color escape sequences. I don't know yet why these escape sequence are outputted in testing. (Needed explicit |
@sttk would this change I made in fancy-log cause this new failure? gulpjs/fancy-log@9a3a662 |
Nice color console require one extra condition: |
Interesting. I'm going to have @sttk chime in as well because I'm guessing I broke something within fancy-log. |
Some plan or idea how to fix it? |
@phated The issue you fixed in above link might be similar to #163. Sample code: (color-test.js) #!/usr/bin/env node
var colorSupport = require('color-support');
console.log('Color support: ', colorSupport()); On MinGW:
On Command Prompt:
|
I've published gulp-test-tools v0.6.2. |
Who can do it or how? |
Restart link is not displayed on my account. @phated Can you restart appveyor test? |
Merge ready? |
@sttk how can we test that errors are being shown correctly? I didn't even realize this method had a 2nd argument. |
index.js
Outdated
cli.on('requireFail', function(name) { | ||
log.warn(ansi.yellow('Failed to load external module'), ansi.magenta(name)); | ||
cli.on('requireFail', function(name, error) { | ||
var message = name + (error ? ' [' + error + ']' : ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since error
is an error object, this code outputs too many lines including stack trace. Isn't it enough error message? And I think it's better that the error message is outputted to next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fo me this message:
Failed to load external module @babel/register [Error: Cannot find module '@babel/core']
is more helpful than:
Failed to load external module @babel/register
I have no idea why @babel/register
doesn't install as dependency @babel/core
but ending was that I add console.log(...) in this place to find this problem :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smialy Sorry, I mistake console.log(new Error() + '')
for console.log(new Error())
.
The former does not output stack trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smialy Now I think this modification is good, but add/modify a test case to test/flag-require.js
, please.
Add small unittest checking extra error message for --require option in case that app has some problem to include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this modification is good and has no problem.
@phated Are you ok with this? |
Should we do some better formatting on this? I'm thinking something like:
Thoughts? |
In this way?
|
I think it's enough only the first two lines and it's good except that. |
Some problem with integration travis-ci and github? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've finished review and please change.
index.js
Outdated
cli.on('requireFail', function(name, error) { | ||
log.warn( | ||
ansi.yellow('Failed to load external module'), | ||
ansi.yellow(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my explanation might be bad. Please modify only a module name to magenta as is.
@sttk sorry that I haven't been around to review, I started a new job a couple weeks ago. Are you satisfied with the PR? I'll restart the appveyor build but I'm confused by what dependency won't install. |
The cause of Appveyor's error is bump deps of These modules are used in |
@phated Please restart Appveyor's test because |
Why was this closed? |
@sttk should I publish this version or do you want to land some more stuff first? |
@smialy thanks for all the hard work on this!!! |
@phated I think it's better to publish |
I meant to follow up on this when 2.1.0 was published. It's been published for 11 days so this fix is available now. Thanks again! |
I spent some time to figure out why:
gulp --require @babel/register ...
not works. Was missing@babel/core
:]