How to increase JSHint maxerr threshold of the Client Method debugger
Again a special interest topic, where only a few gifted persons will understand what it’s all about. Admins who actually program within Innovator will be familiar with the Method ItemType. A simple debugger is available for JavaScript methods, which is useful for basic syntax checks.
The code analysis tool used in Aras is JSHint. Therefore, we have to face some of the typical limitations of JSHint. In addition to the lack of support for modern JS stuff like async/await and the general lack of ways to check the accuracy of your code – JSHint will simply stop working if JavaScript Methods get too long. In this case the following message will appear in the debug window:
As soon as you reached the magic limit, JSHint will refuse to highlight syntax errors. And the longer your Method gets, the more you will miss this minimalist help. Fortunately, the solution is not difficult at all. We just have to increase the maxerr threshold of JSHint.
- Open the following file in the code tree: ..\Innovator\Client\scripts\CodeEditor\javascript\src-min-noconflict\worker-javascript.js
- Don´t be scared of the minified file!
- Search for maxerr:100
- Increase the value, e.g. to maxerr:200 and save the file
- After clearing the browser cache, the debugger should now work reliably (until you reach the limit again…)
- As this one is codetree change, it will be overwritten in Aras update. So add this modification to your test plan
Tested with Innovator 12. Use at your own risk!
You are so awesome! I don’t believe I’ve truly read something like this before.
So wonderful to find somebody with a few original thoughts on this issue.
Seriously.. many thanks for starting this up. This website is something that is needed on the web, someone with a little originality!
Hi there, just became alert to your blog through Google,
and found that it’s truly informative. I’m gonna watch out for brussels.
I will appreciate if you continue this in future.
Numerous people will be benefited from your writing.
Cheers!