How to find syntax errors with Sencha Architect 3 (Rhino Parse Errors)
When during a build of Sencha Architect 3 the log shows so called Rhino Parse Errors due to syntax errors it takes a bit of trouble finding the source code in error.
What this dialog shows is that there is a syntax error found. What it shows is where the syntax error is found: MyWindow.js. What is also shows is on what line the syntax error is found: 92:5.
The image above is taken from a DOS command prompt, where I run the build statement that is also executed within Sencha Architect. A great advantage of doing it in a dos command prompt is that it will stop after it finds a syntax error.
But if you look in the editor of Sencha Architect, you will see that the line numbers don't correspond with error log.
To find the line number 92 in MyWindow.js, you have to open with an external editor this file in folder app of your locally stored project.
As you can see in the image above is that line 92 is the one in error. The map.addMarker function at line 91 is not closed correctly. So let's have a look in the Sencha Architect editor if it shows there an error too.
Yes it does. But in this editor on line 76. Not very helpful if you want to debug the errors in Sencha Architect. Notice that you only will experience this at the moment you switch off the JSLint checker in Architect. And that you might do because it is slowing down the editing quite a bit.