[Resolved] c2runtime.js errors with minify script checked

0 favourites
  • 10 posts
From the Asset Store
Here is the wonderful & amazing script for your website or fun with maths.
  • Dears,

    I recently released my first game thanks to Construct 2 (and I'm very grateful to Scirra for that ).

    I now plan to release upcoming updates & features with Construct 3.

    Yesterday I gave C3 a serious try, and imported my whole C2 project into C3.

    Everything works fine in preview except some AJAX calls on local (which I understand because I'm currently not serving those files over https).

    Anyway, when I export it to "Web (HTML5)" with "Minify script" checked, game is not starting.

    I checked the browser console, and it mentions 2 following errors:

    • Uncaught SyntaxError: Illegal break statement at c2runtime.js:2
    • Uncaught TypeError: g_a.g_jx is not a function at g.g_iC (c2runtime.js:2) at XMLHttpRequest.g_gf.e.onload (c2runtime.js:2)

    You can see/test it live here:

    Do you have any ideas what is wrong?

    Is this an issue due to some of my code? What should I do? Is it just a compilation issue?

    Thanks for your answer, folks.

  • If you use the Physics behavior, it's probably this bug. Otherwise please file a new bug following all the guidelines.

  • Thank you Ashley for your quick answer.

    I don't use Physics behavior in my game, only the following:

    • Fade;
    • Flash;
    • Platform;
    • Timer;

    Ok, I'll create the bug tomorrow.

    I don't mind sharing my capx with Scirra, but not open to the public since I released the game few days ago.

    Edit: I also use Timer behavior. I don't use Pin behavior anymore, so I removed it from the list.

  • I have a similar issue as well. Game exports however it shows up as a blank page. I just minifiy the runtime with a 3rd party app.

  • I have a similar issue as well. Game exports however it shows up as a blank page. I just minifiy the runtime with a 3rd party app.

    If you open the browser console, what errors do you have?

    This may also come from your 3rd party app. Which one do you use?

  • Not using any 3rd party addon's/plugins/behaviors. Also don't have access to the minified version at the moment. As well, not using any physics...

  • If you use the Physics behavior, it's probably this bug. Otherwise please file a new bug following all the guidelines.

    Hey, Ashley!

    S'ry for the delay. I really wanted to give you a proper answer before filing a new bug.

    So, I started a new C3 project from scratch with following behaviors: Fade, Flash, Platform, Timer.

    I put some simple events with a Hero and Boss to get a basic Bossfight, and I exported the project.

    Game is running fine even with Minify script checked on export options.

    Game example: c3-test-export

    Capx: c3-test-export.c3p

    I guess the issue is coming from the code of my game Bikosaur (initially made with C2).

    Due to the amount of events (around 500 lines) and complexity, I don't think it has sense to find out what is exactly wrong since the game is already live.

    I plan to use directly C3 for future updates and projects so that's fine to me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not using any 3rd party addon's/plugins/behaviors. Also don't have access to the minified version at the moment. As well, not using any physics...

    You said you minify the runtime.js file with a 3rd party app.

    Which 3rd party app is it? This may be the issue. Btw, I don't think it has sense to manually minify it.

  • Please check you're using r54, we just fixed a minify bug. If you still have issues please post to the issue tracker following all the guidelines.

  • Well, it looks like r54 resolves the issue.

    The game is now working well, even with minify script checked at export.

    Good job, guys!

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