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
213