R213 problem with minifing scripts and running in Chrome

Bugs will be moved here once resolved.

Post » Thu Sep 10, 2015 3:49 am

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
; ;) 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
Last edited by stachir on Fri Sep 11, 2015 11:26 pm, edited 1 time in total.
B
22
S
3
G
2
Posts: 30
Reputation: 3,693

Post » Thu Sep 10, 2015 12:33 pm

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 :'(
B
9
S
2
G
1
Posts: 19
Reputation: 660

Post » Thu Sep 10, 2015 12:48 pm

Same issue, im running both x86 and 64 bit java and even tried re-downloading both but that doesnt fix the problems
B
32
S
7
Posts: 24
Reputation: 1,570

Post » Thu Sep 10, 2015 4:19 pm

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:

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

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

index.html:92
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)
Last edited by Paradox on Fri Sep 11, 2015 8:48 am, edited 1 time in total.
B
241
S
63
G
33
Posts: 903
Reputation: 40,729

Post » Thu Sep 10, 2015 9:35 pm

Same issue for me. Black screen on Chrome...
B
44
S
10
G
7
Posts: 183
Reputation: 10,098

Post » Fri Sep 11, 2015 2:04 am

I got the same issue!
R213.
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.
B
24
S
3
G
1
Posts: 1
Reputation: 1,977

Post » Fri Sep 11, 2015 1:19 pm

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
B
58
S
17
G
10
Posts: 158
Reputation: 22,368

Post » Fri Sep 11, 2015 2:03 pm

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.
B
241
S
63
G
33
Posts: 903
Reputation: 40,729

Post » Fri Sep 11, 2015 11:25 pm

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;
to
var ret = 0;

For me, that worked , and as You saw - yes, it's because of Audio update ;) ( 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.
Last edited by stachir on Sun Sep 13, 2015 9:37 am, edited 1 time in total.
B
22
S
3
G
2
Posts: 30
Reputation: 3,693

Post » Sat Sep 12, 2015 5:43 pm

Same here!
B
93
S
31
G
11
Posts: 654
Reputation: 11,832

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest