PDA

View Full Version : Problem with JSBuilder



zaza1851983
16 Sep 2010, 4:07 AM
Hello

I have a project built with Extjs and using jsbuilder to to build one js file containing extjs as well as our project's code. This has been working fine for a long time now.
I tried today our build script, and the jsbuilder is producing the following error:



[java] Loading the 'Pronto' Project
[java] Loaded 43 Packages
[java] Compressing output files...
[java] [ERROR] 207:3:syntax error
[java] [ERROR] 208:24:missing ; before statement
[java] [ERROR] 210:3:syntax error
[java] [ERROR] 211:3:unterminated regular expression literal
[java] [ERROR] 212:5:syntax error
[java] [ERROR] 1:0:Compilation produced 5 syntax errors.
[java] org.mozilla.javascript.EvaluatorException: Compilation produced 5 syntax errors.
[java] at com.extjs.JSBuilder2$2.runtimeError(JSBuilder2.java:325)
[java] at org.mozilla.javascript.Parser.parse(Parser.java:410)
[java] at org.mozilla.javascript.Parser.parse(Parser.java:355)
[java] at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
[java] at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
[java] at com.extjs.JSBuilder2.compressOutputFiles(JSBuilder2.java:302)
[java] at com.extjs.JSBuilder2.main(JSBuilder2.java:45)
[java] Java Result: 2
I did minor changes to the jsb file lately and I don't think that that's the problem. Although I updated my ubuntu packages lately, and as far as I know jsbuilder uses some mozilla packages, right?

one sees from the error message, that the single package are generated and the single debug js file is also generated. The problem happens while creating the compressed final js file.

Ubuntu 9.10
JSbuilder2
Extjs 3.1.1

Best regards

zaza1851983
23 Sep 2010, 1:02 AM
Found the problem.
In a js file, there were the following lines:


/**
* @requires OpenLayers/Projection.js
* @requires OpenLayers/BaseTypes/LonLat.js
*
* @requires Ext/util/MixedCollection.js
*/

Which were used by jsmin of OpenLayers. After removing them it worked out fine.The thing is the the debug and compressed version of the single files have been generated successfully, as well as the debug version of the complete js file. The error appeared while generating the final compressed js.
Still have no idea, why these lines caused an error. Too bad that the error message is not clearer

Thnx anyway

creimer
11 Jul 2012, 4:22 AM
Do you remember which js file you modified? I'm coming up with the exact same error. Would greatly appreciate a solution for this problem.
Thank you


Found the problem.
In a js file, there were the following lines:


/**
* @requires OpenLayers/Projection.js
* @requires OpenLayers/BaseTypes/LonLat.js
*
* @requires Ext/util/MixedCollection.js
*/

Which were used by jsmin of OpenLayers. After removing them it worked out fine.The thing is the the debug and compressed version of the single files have been generated successfully, as well as the debug version of the complete js file. The error appeared while generating the final compressed js.
Still have no idea, why these lines caused an error. Too bad that the error message is not clearer

Thnx anyway

zaza1851983
11 Jul 2012, 4:47 AM
No sorry. I don't even have access to that source code anymore.
But my advice is, start simple with only importing the standard js files (i.e. from Extjs and openlayers) then start inclduing your own js files one by one and compile each time and make sure that a final compressed js file is generated successfully. This is a very tricky error that jsbuilder won't point you out to. so be careful when adding js files. and remove any inclusion that's not really being used

Good luck