How to debug in javascript? specifically in angular2

0

Recently it has happened to me that I had an error, called EXCEPTION: Can not resolve all parameters ...

I found that it was possibly because of the barrels, because when I tried to see the source of the error from my console, only that message came out, and I had no way of seeing where to find the error, followed what I was advised to try not to use the barrels, delete all the index.ts and adapt, I was around 2 hours in this error.

Then I started comparing a previous commit to see what the difference was, and it turns out that it was because in a barrel.ts the service, import 2 times the same service, erase 1 and everything ran perfectly.

It is an error that can happen to you as a; in other languages such as c / c ++, but in that case the compiler warns you, use jit, to compile, to avoid this kind of thing, which tools to debug at compile time for js exist?

    
asked by Kevin AB 04.05.2017 в 05:03
source

1 answer

1

Well it depends, I think that for js or ts the debugger case does not apply, since debugger is when intesta run your application testing every element or class built so that having an error stops the operation. I think that for your case what you need is something like linter so that you can see the possible syntax erorres in js.

You could use JShint para js, o JShint-linter .. If you use a text editor as atom o sublime you can find these packages and install them. They are very helpful when programming front - end. Greetings

    
answered by 04.05.2017 в 05:37