java2script icon indicating copy to clipboard operation
java2script copied to clipboard

package.js not found error with window.console

Open dkosovic opened this issue 3 months ago • 15 comments

Hi,

When I use console: window.console instead of console:'sysoutdiv' I see the following error in the web browser console about package.js not being found:

swingjs2.js:13212 j2sApplet exec TensionApplet loadClazz null -- OK
swingjs2.js:9669 xhr.open async=false url=../../../site/swingjs/j2s/core/package.js
swingjs2.js:9709   GET https://dkosovic.github.io/eVibJS/site/swingjs/j2s/core/package.js 404 (Not Found)
send @ swingjs2.js:9709
ajax @ swingjs2.js:9234
J2S.$ajax @ swingjs2.js:11011
J2S.getFileData @ swingjs2.js:11689
Clazz.loadScript @ swingjs2.js:17195
_Loader.loadClass._Loader.loadClass @ swingjs2.js:16951
_Loader.loadPackageClasspath @ swingjs2.js:16901
__loadClazz @ swingjs2.js:13242
__nextExecution @ swingjs2.js:13214
setTimeout
proto._setupJS @ swingjs2.js:13539
proto._init @ swingjs2.js:13380
J2S._Canvas2D @ swingjs2.js:13352
Applet._getCanvas @ swingjs2.js:22036
Applet._get @ swingjs2.js:22011
SwingJS.getApplet @ swingjs2.js:21901
(anonymous) @ Tension.html:39
swingjs2.js:17544 [Java2Script] The required class file 

../../../site/swingjs/j2s/core/package.js
was not found.


SyntaxError: Unexpected token '<'
    at evaluate (https://dkosovic.github.io/eVibJS/site/swingjs/swingjs2.js:17092:30)
    at Clazz.loadScript (https://dkosovic.github.io/eVibJS/site/swingjs/swingjs2.js:17196:5)
    at _Loader.loadClass._Loader.loadClass (https://dkosovic.github.io/eVibJS/site/swingjs/swingjs2.js:16951:10)
    at _Loader.loadPackageClasspath (https://dkosovic.github.io/eVibJS/site/swingjs/swingjs2.js:16901:14)
    at Array.__loadClazz (https://dkosovic.github.io/eVibJS/site/swingjs/swingjs2.js:13242:18)
    at __nextExecution (https://dkosovic.github.io/eVibJS/site/swingjs/swingjs2.js:13214:7)

swingjs2.js:17544 SyntaxError: Unexpected token '<' loading ../../../site/swingjs/j2s/core/package.js

swingjs2.js:17544 j2sApplet exec TensionApplet start applet null

swingjs2.js:13212 j2sApplet exec TensionApplet start applet null -- OK
swingjs2.js:9669 xhr.open async=false url=../../../site/swingjs/j2s/java/lang/Class.js
swingjs2.js:17542  transpiler was unknown now 5.0.1-v7 for java.lang.Class

Con.consoleOutput @ swingjs2.js:17542
(anonymous) @ swingjs2.js:17893
ps.println.ps.println$.ps.println$Z.ps.println$I.ps.println$S.ps.println$C.ps.println$O @ swingjs2.js:17869

It seems to be happening at line 17544 in swingjs2.js : https://github.com/dkosovic/eVibJS/blob/3e9eece2722b8ca5d8729c94f4a04081e3269d7f/site/swingjs/swingjs2.js#L17540-L17545

This was the HTML I was using: https://github.com/dkosovic/eVibJS/blob/gh-pages/Programs/General/Prog1/Tension.html

I'm not sure if the package.js not being found error is because I'm doing something wrong? The applet is working fine otherwise.

dkosovic avatar Oct 15 '25 12:10 dkosovic