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
Some error messages are missing in v4.3.0 #9011
Comments
I am getting the same error as you indicated from 4.2.0. My configuration is the following: eslint: v4.3.0 However, I do see the same(lack of) error when I switched to node 8.2.1 |
Hmm, this is more complicated than I thought. It seems like Node has a strange behavior with error stacks -- modifying the message will also modify the stack, but only if the stack has never been previously accessed. const err = new Error('original message');
err.message = 'updated message';
console.log(err.stack);
// => Error: updated message
// (followed by stack trace) const err = new Error('original message');
// access the stack property
err.stack;
err.message = 'updated message';
console.log(err.stack);
// => Error: original message
// (followed by stack trace) There doesn't appear to be a getter on This applies in both Node 8.2.1 and Node 6.11.1. However, the difference in behavior between the two Node versions is probably related to nodeca/js-yaml#351, which might also be caused by weird |
I made a partial fix upstream in nodeca/js-yaml#360. This will make sure at least some error message is present, rather than having the stack be empty. However, the stack still won't update after the The root cause of the issue is this commit in V8, which was first introduced in Node 7. Stack traces are evaluated lazily in Node (they are only created the first time the The commit in V8 was reverted a few weeks ago here, but it might take awhile before that lands in a Node release. Also, I'm not sure we should rely on this behavior, since it seems risky to rely on whether the |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue.
a
What did you expect to happen?
I expected to receive a useful error message indicating that the configuration was invalid.
What actually happened? Please include the actual, raw output from ESLint.
In 4.2.0, the error also included a message:
This is a regression caused by a5fd101. To avoid duplicated error messages, we stopped printing
error.message
for uncaught exceptions since the message is usually already contained inerror.stack
. However, there are several places where we mutateerror.message
after creating an error in order to add additional information, so the information is now getting lost.The text was updated successfully, but these errors were encountered: