Javascript error on startup

0 favourites
  • 15 posts
From the Asset Store
The perfect way to start development of multiplayer games
  • I've a perplexing problem! It began just tonight, when I downloaded r213.

    When I run my game locally (preview mode), it works just fine, but...

    1) The minification process no longer works. It warns me about needing 64-bit Java, but I know I already have 64-bit Java installed.

    2) When I try to start the game in Chrome (from my server), I get a console error saying "Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode". I looked at the source, and sure enough, the script had a let expression with no mention of "use strict".

    Why is this happening? The live copy of my game is currently unplayable (black screen - not even a loading bar)! Help!

  • r213 is a beta, and as such, can come with problems, some of which have already been posted in the bug section (and some sound similar to your problems). Beta's are used at users own risk.

    My advice, go back to r212.2 if you really need stability, especially now that Ashley has far less time now that he is an active development of C3 as well as keeping C2 going. It could be weeks for a fix to come out for r213.

  • That makes sense, but unfortunately now it's been saved in 213, I can't open my project again in 212.2. To make things worse, after I upgraded my computer I apparently forgot to enable backups on this one, so I can't even go back to my last save in 212.2. Is there anything else I can do (potentially even editing the version number in the XML)?

  • edit the caproj file with editor, the part you are looking for is:

    <saved-with-version>18800</saved-with-version>

  • Sigh, yeah, I downloaded it as I was finishing my game for the underground jam-- well doesn't look like the game is loading :/

    Tell if you can play my game plz--

    https://www.scirra.com/arcade/undergrou ... tters-2351

    I also found this great news about Chrome and no longer supporting

    Java

    https://java.com/en/download/faq/chrome.xml

  • BurningWood: Yep, your game doesn't play either.

    fldr: That fixed it! Thanks!

  • Thanks for checking--

    Also, I'm re-downloading r212-2 from the Scirra. How did you revert the file? And did you open it in r212-2?

    fldr

    I found this <saved-with-version>21300</saved-with-version> what's the next step?

  • and fldr figured it out, my games live, thanks.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I also found this great news about Chrome and no longer supporting

    Java

    https://java.com/en/download/faq/chrome.xml

    Actually, C2 games don't require any plugins to work (no flash, no vlc, no nothing, that is also true for java, the java plugin is not needed, and AFAIK never was), as they use only javascript (which is totally, completely unrelated to java. I know, the names seems to fit just perfectly and that would imply they are directly related but no, it is just that the names look the same.), however java is required to run the minifier, but that is, again, not related to running the final game, it is just that C2 needs to run a specific java file on export if minification is enabled, and java is not required for the actual person that will run your game.

  • Aphrodite Thanks for clearing that up. After the whole UNITY not working on the web on Chrome, I was afraid something like this may happen to C2.

  • Aphrodite Thanks for clearing that up. After the whole UNITY not working on the web on Chrome, I was afraid something like this may happen to C2.

    Yeah, the unity plugin was disabled in chrome (actually, every plugin using the Netscape Plugin API was disabled (Java, Silverlight, Unity web player, etc..), flash in chrome uses the Pepper Plugin API, thus is still useable though, I think this month they will be disabled for good inside chrome, with no flags to turn them back on).

    Construct 2 never relied on any browser plugin for its html5 exporter to prevent those sort of things from happening, they did rely on third parties for wrapping games inside executable files but that is a different story alltogether.

    That implies that the actual webbrowser is doing all the work of the game, instead of simply displaying a window with another program doing everything, and since browsers have different engines, the result can vary from one to another more than with using a plugin (plugin that can (will?) be platform specific anyway or will be disabled for x or y reason).

  • I got the problem solved (as a workaround) by adding "use strict"; at the beginning of c2runtime.js, after exporting my project.

  • "use strict";

    didnt work for me. Do i need to insert it somewhere specific?

  • edit the caproj file with editor, the part you are looking for is:

    <saved-with-version>18800</saved-with-version>

    How do i do this with an capx?

  • Nevermind, just unzipped it..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)