R213 problem with minifing scripts and running in Chrome

0 favourites
  • Problem Description

    Script can't be minified, and not-minified exported projects' scripts do not open in Chrome browser

    Attach a Capx


    Description of Capx


    Steps to Reproduce Bug

    issue with not working minify is related to big projects that needs 64bit java

    issue with not opening exported projects in browser is related to any projects exported to website in 213 C2 version

    Observed Result

    Big projects' scripts can't be minified and popout shows up exectly like here - can-t-minify-project_t148041 . And like in that topic, I tried to change java version, but nothing worked. Then I thought about downgrading Construct 2 from 213 to 211 and it worked - I could do minify projects' script without any problems.

    In C2 v213 I found that, even exported projects with not-minified scripts could not work in Chrome. There was no such problem with C2 v211.

    After short investigation (with Chrome DevTools-console) I found something strange when I tried to run in Chrome my exported project anyway:

    Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode - c2runtime.js:17068

    Uncaught ReferenceError: cr_createRuntime is not defined - index.html:99

    Uncaught ReferenceError: cr_sizeCanvas is not defined - index.html:92

    ok, so I looked at c2runtime.js and I found what was at 17068 line and I compered that to similar code from earlier C2 version. Problem was caused with:

    C2AudioInstance.prototype.getDuration = function (applyPlaybackRate)

    now there is let ret = 0; and it should be var ret = 0; <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink"> it looks like Chrome still can't work with ES6 / ES2015 ? (I checked same exported project in Internet Explorer 11 and it worked.)

    Next I found :

    Uncaught (in promise) DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV). - index.html:118

    it's talking about this line:

    navigator.serviceWorker.register("sw.js", { scope: "./" });

    but I don't know what is really wrong here Oo

    Expected Result

    minifing scripts should work ;p

    not-minified scripts' projects should also work ;p

    Affected Browsers

    Chrome 45.0.2454.85 m

    Internet Explorer 11

    Operating System and Service Pack

    Windows 8.1

    Construct 2 Version ID


  • Having this same issue on R213 about script not being minified.

    Using Windows 8.1.

    Even updated to the latest Java (Java 8 Update 60 for 64 bit).

    However, I am exporting as Cordova from Construct and then using Intel XDK to transform it into an iOS app. The app just opens as a black screen and does nothing.

    Can't test to see if the new release addresses our audio problems :'(

  • Same issue, im running both x86 and 64 bit java and even tried re-downloading both but that doesnt fix the problems

  • I just came here looking to see why it started happening to me.

    In chrome I got a black screen and on the console it says:


    Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode


    Uncaught ReferenceError: cr_createRuntime is not defined


    Uncaught ReferenceError: cr_sizeCanvas is not defined

    Edit: odd, I deleted the Audio object, and minimize worked. (but chrome still didn't)

    Had to submit my game Jam entry with a disclaimer for Chrome, hope that doesn't count against it.

    (World of Mineshaft)

  • Same issue for me. Black screen on Chrome...

  • I got the same issue!


    If I use "run layout", it can run on Chrome. But if I use "export project", I got black screen on Chrome, Firefox, and Opera. (Both on PC and mobile devices).

    It can run on IE 10.

  • I got the same issue!

    Export for Windows 10 ( script not being minified )

    And windows 10 adv. not work...

    I don't see adv. in visual studio preview

  • It's the audio plug in.

    With the plugin it won't play in chrome and firefox, (didn't test opera)

    https://www.scirra.com/arcade/undergrou ... shaft-2339 (now fixed)

    Without the plugin, no sound but:

    https://dl.dropboxusercontent.com/u/854 ... index.html

    Edit: Rolled back to 212.2 and it exported fine. Hopefully reuploading it won't affect the judging.

  • As I wrote before, You can try that:

    • go to generated/exported not-minified project folder and find c2runtime.js file
    • find function that starts like: C2AudioInstance.prototype.getDuration = function (applyPlaybackRate)
    • change

    let ret = 0;


    var ret = 0;

    For me, that worked , and as You saw - yes, it's because of Audio update <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink"> ( as expected from update post - https://www.scirra.com/construct2/releases/r213 ... ;p trololololo )

    You can also downgrade C2 to 211.2, here all works, but you also need project with that version.

    (If you are wonder, audio duration function was rebuild from R211 to R213 and disposed from multiple "return" instructions for one instead.)

    The other two errors:

    Uncaught ReferenceError: cr_createRuntime is not defined

    Uncaught ReferenceError: cr_sizeCanvas is not defined

    are caused by the first one, so they will gone after modification that I wrote above.

  • Same here!

  • same problem! I've made a big game and it doesn't work right but when I make something super small it will work fine.


  • Now I'm using:

    • Construct 2 R212.2 x64
    • Java 1.8.0_60 (JDK 8u60) x64
    • Windows 10 Pro (10.0.10240) x64

    And no problem at all!

    But using Construct 2 R213 x64 is another history!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I thought I was going crazy. Thanks this is a bug and not a problem with my game.

  • Yeah this definitely needs to fixed.. I have a black screen as well when exporting as an Android App.. I'll be re-rolling back to 212.2 until this fixed..

  • I'm gonna sound like an ass but it's just not even funny, like, the stress we are having... in our case we recently released a game on iOS and got some good numbers, only to later realize there's somewhat infrequent but catastrophic audio problems (not a problem with the game)! We exported after 206 which had apparently had audio bugs or clashing with Safari in some way. Beta 213 should have fixed this but we still get the audio issues and now we're presented with a lovely black screen too...

    As was suggested earlier in this thread, tried this:

    • find function that starts like: C2AudioInstance.prototype.getDuration = function (applyPlaybackRate)
    • change

    let ret = 0;


    var ret = 0;

    Black screen is gone, game works (unminified of course), but still get audio issues 213 was apparently going to address...

    We're very apprehensive to push a much needed update for the game just in case the problems get worse! Would have been great if we could have done that while we were riding on the wave of downloads we were having...

    We are so behind!


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