Error messages are hard to understand for newcomers #573
Comments
To second this, I just want to share my thoughts looking at the error from literally the first thing I tried with typings:
Two things right off the bat: First off, this is the example invocation from the tsd 'getting started', but it does not work with typings and the error message is incomprehensible. Second off, this is the kind of message that is more useful to someone who understands the internals of typings well enough to submit a pull request, than someone who is new or simply wishes to use it. Some things a new user might not know are:
One thing that would help here is including a sample invocation. If Finally: The message is verbose, cluttered and the fact there is too much information gets in the way of understanding. The repeated "typings ERR!" makes this VERY hard to read and the EXCLAMATION POINTS! adds a sense of panic which is unhelpful. The "caused by" is more confusing than helpful; it is absolutely ridiculous you're printing HTTP status codes in an error message. You should not expect the user of your program to know what HTTP status code 200 is. Providing the user with a space-delineated breakdown of what they just entered ("typings" "install" "jquery") is similarly much more distracting than helpful. That entire middle block starting with "cwd C:" and ending with "typings -v" should be removed; if you don't want to remove it because it's helpful in reporting errors upstream, move it AFTER the "please file an issue" block and preface it with |
Hey there, new here , and experiencing the "However, we found "xxxx" for 1 other source: "dt"" message. yes , clearly it s hard to figure out what to do next. typings install dt~socket.io-client --save --global solved the issue what not so easy to find. |
@accessdev Wow this saved me hours of googling. Thanks!! |
Several attempts to use 'Typings' in vscode Typescript projects have left me completely baffled. Nothing I've read so far has made much sense. Simply does not work! going back to DT! Try using ws.d.ts in any project using this tool. I can get CLI success using dt~ws, but Typescript can never find the d.ts file? |
@nhrones did you list |
@nhrones Please provide more detail when commenting. We're all people here trying to do our best. Can you elaborate on "going back to DT!". Typings consumes DT, so that comment really doesn't make any sense. Do you mean you're going back to copying and pasting files? If all you're interested in is consuming DefinitelyTyped, I'd recommend using the preferred approach of NPM |
@blakeembrey as a fairly recent Typings user the two biggest problems I have with its usability:
Please excuse me from writing it this way but that's probably close to how a typical user thinks: I don't care about your internals, just give me my stuff. To give you an example of my Typings session from a few minutes ago (and that was not my first time using it, the previous times I had to google for help):
Best would be to just use dt if that's where the files are, and automatically use globals/local wherever the definition is found. If that's not possible for some reason, how about:
|
Description
When coming from TSD to Typings, error message are not so clear, and do not help solving problems most people get.
For example, when using git, if I try to push a branch that has not upstream branch, I get this message :
So I understand what the problem is, and I get a solution that is useful most of the times. Moreover, I understand that this is a standard error, I don't have to panic and a solution is easy to find.
From all error messages I got with typings, none of them helped me understand what the problem was or how to fix it. Moreover, the useful and explanatory part was hidden in the middle of verbose error output shown by default (like
responded with 404, expected it to equal 200
), and it feels like something went really wrong, while most of the case this is just a basic error that is easy to resolve.First time I went from TSD to Typings, I dropped it after 10 minutes, as
typings search
never returned any results where TSD was working (I had to useambiant
flag), or returned results but refused to install found results, and errors messages didn't help.Many people start using typings because of a deprecation message from STD, but if they get many errors and need a lot of time to figure out why just after switching to Typings, they might go back to TSD.
And when looking at reported issues, it looks like I'm not the only one (https://github.com/typings/typings/issues?utf8=%E2%9C%93&q=404), what is sad because otherwise Typings is really really great :) ! (Plus it might save you a lot of time by not having to deal with issues that are not real issues)
Here are some examples of problems I got, and where error messages confused me without helping me find a solution :
Scenario 1
Steps to Reproduce
typings install angular
Expected behavior:
Having an error message with most common solutions to this problems, or to an article describing it.
For example,
Try adding --ambient flag
(when coming from TSD, it's the case 99% of times), or a link to a wiki page explaining what are sources, and giving concrete examples.Actual behavior:
I get this error message :
Unable to find "angular" ("npm") in the registry. Did you want to try searching another source? Also, if you want contribute these typings, please help us: https://github.com/typings/registry
that doesn't help so much.Moreover, I get many verbose error messages, like
caused by https://api.typings.org/entries/npm/angular/versions/latest responded with 404, expected it to equal 200
that look like something went really wrong, while it is just something common.
Scenario 2
Steps to Reproduce
typings search gulp-protractor
typings install gulp-protractor
typings install dt~gulp-protractor
Expected behavior:
As a result was found, I don't expect to get an error at step 2.
Or if an error occurs, I would like to get advices to fix it ; instead I have to search in Issues or StackOverflow, and understanding why this error occurs is not obvious.
At step 5, I would like to get a hint, like "try using --global flag".
Actual behavior:
I get many confusing error messages, and have to spend time figuring out why (worse, I could post duplicate Error reports on Github, that will waste your time to answer).
The text was updated successfully, but these errors were encountered: