Javascript mode stopped working. Any suggestions?

edited May 2014 in JavaScript Mode

The past few weeks, Processing sketches that used to run fine on my laptop (Mac OSX 10.9.3) in Javascript mode no longer run. When I try to run them, a browser window opens and it sits there stuck on "Waiting for 127.0.0.1", and the Processing console gives me this:

Exception in thread "Processing.BasicServer" java.lang.NoSuchMethodError: processing.app.Base.showWarning(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V at de.bezier.mode.javascript.JavaScriptBuild.build(Unknown Source) at de.bezier.mode.javascript.JavaScriptBuild.export(Unknown Source) at de.bezier.mode.javascript.JavaScriptMode.handleExport(Unknown Source) at de.bezier.mode.javascript.JavaScriptEditor.handleExport(Unknown Source) at de.bezier.mode.javascript.JavaScriptEditor.serverStarted(Unknown Source) at de.bezier.mode.javascript.BasicServer.run(Unknown Source) at java.lang.Thread.run(Thread.java:745)

Tonight I saw that there was a new Version 2.2, so I upgraded from 2.1.2, hoping that would fix the problem, but it does not.

Any suggestions what might be wrong and how I can fix it? In addition to not being able to run my sketches in Javascript mode, I can no longer export the project either.

Answers

  • Perhaps you should delete the subfolder "modes/JavaScriptMode" inside your sketchbook folder? And then, reinstall it? :-/
    Another option is directly open the generated "index.html" inside "web-export" subfolder under a Firefox browser.
    Firefox and derivatives like Seamonkey, Palemoon, Waterfox, Songbird, etc. still allow running scripts w/o a server! :bz

  • Thanks for the suggestion. I'll try deleting the JavaScriptMode folder and reinstalling.

    Unfortunately, I can't open the index.html file, because another effect of this problem is that when I try to export a project, the index.html file isn't generated :-/

  • Well, the JavaScriptMode suggestion sounded like a good one, but I tried deleting the folder and reinstalling JavaScript mode, but I'm still getting the same malfunction :-(

  • I can't open the index.html file, because another effect of this problem is that when I try to export a project, the index.html file isn't generated.

    That file is generated by merely clicking at the Run button or hit CTRL+R! >-)

  • Unfortunately, that wasn't working for me either... when I ran the sketch in Javascript mode, the index.html file was not being created.

    However, it looks like I found the cause of the problem. I started deleting code from the sketch until almost nothing was left but the basic setup, and it was still failing.

    But then I changed the size() call, and it started working. I had been defining a global variable and then using it to set the window size, like:

    int winsize = 600
    
    void setup(){
       size(winsize,winsize);
    }
    

    and then i changed the size to use constant values instead:

    size(600,600);
    

    and that did it. So apparently Javascript mode can't handle size parameters defined in a variable... which is weird, because it used to work just fine. I have sketches right now on OpenProcessing that are running fine in js mode with variables in the size call. So I dunno what's up with it. But at least I can make it work.

  • edited May 2014

    So all this time, you had never tested some1 else's code? And concluded JS Mode wasn't working due to 1 app of yours? :-&
    Indeed I've got some online examples which use variables as size()'s parameters.
    But generally, I post from Java Mode to online hosts w/o testing them in JS mode 1st! 8-|

    http://studio.processingtogether.com/sp/pad/export/ro.9LZizxKsIAY4F/latest
    http://studio.processingtogether.com/sp/pad/export/ro.98-pSvW97Q-RE/latest
    http://studio.processingtogether.com/sp/pad/export/ro.9ABG0RKl9D2Bx/latest

  • edited May 2014

    actually, i concluded it wasn't working based on testing numerous sketches that all had the same problem and looking online for possible solutions. i didn't post my request after just a single test on a single app.

Sign In or Register to comment.