yglukhov / nimx

GUI library
MIT License
1.09k stars 75 forks source link

Live demo not working #330

Closed wtjones closed 5 years ago

wtjones commented 6 years ago

Doesn’t finish loading. iOS 11

metasyn commented 6 years ago

I dont think its limited to iOS safari - it doesn't load for me on Firefox (62), macOS, either.

timotheecour commented 5 years ago

/cc @yglukhov

indeed. on OSX in chrome shows this:

image

developper window shows:

Uncaught TypeError: Cannot read property 'concat' of null
    at sz (main.js:840)
    at wE (main.js:1289)
    at FE (main.js:1313)
    at main.js:1356
    at ME (main.js:1334)
    at PE (main.js:1350)
    at AF (main.js:1588)
    at AF (main.js:1594)
    at AF (main.js:1594)
    at AF (main.js:1594)
jabbalaci commented 5 years ago

Clicking on "Live demo in WebGL" gives a 404 error now.

timotheecour commented 5 years ago

not anymore, maybe the recent fix to CI (that now passes) fixed the 404 error; the issue still remains though ;

/cc @yglukhov could you rename the issue titile with "Live demo not working" ? how could one run the demo not minified for debugging? the minimified js isn't very helpful:

function fq(a,c){var b=null,e={h:"abstract_asset_bundle.urlForPath",f:d,filename:"../nimx/assets/abstract_asset_bundle.nim",line:0};d=e;a:do if(e.line=500,K(a.w,Il)){e.line=10;b=c;d=c={h:"web_asset_bundle.urlForPath",f:d,filename:"../nimx/assets/web_asset_bundle.nim",line:0};null===Ep[0]?(c.line=26,b=D(null,Rp(a.mBaseUrl,b),q)):(c.line=28,b=D(null,Ep[0](Rp(z("res"),b)),q),Pp(b,z("http"))||(c.line=30,b=D(null,Rp(a.mHref,b),q)));d=c.f;break a}else if(K(a.w,qm)){e.line=10;d=a={h:"abstract_asset_bundle.urlForPath",
f:d,filename:"../nimx/assets/abstract_asset_bundle.nim",line:0};a.line=10;d=b={h:"abstract_asset_bundle.abstractMethod",f:d,filename:"../nimx/assets/abstract_asset_bundle.nim",line:0};b.line=2947;b.line=2948;c={w:Jm,parent:null,name:null,message:null,trace:null,raiseId:0,up:null};b.line=7;c.message=D(null,z("Abstract method called"),q);b.line=2943;c.parent=null;b.line=7;Sm(c,"Exception");d=b.f;d=a.f;b=null;break a}while(0);d=e.f;return b}
function qz(a){var c=!1,b={h:"image.isLoaded",f:d,filename:"../nimx/image.nim",line:0};d=b;a:do if(b.line=500,K(a.w,Gf)){b.line=192;c=a;d=a={h:"image.isLoaded",f:d,filename:"../nimx/image.nim",line:0};a.line=202;c=qz(c.spriteSheet);d=a.f;break a}else if(K(a.w,Fl)){b.line=192;var e={h:"image.isLoaded",f:d,filename:"../nimx/image.nim",line:0};d=e;e.line=196;c=null!==a.texture;c||(e.line=198,c=a.oa.complete);d=e.f;break a}else if(K(a.w,sl)){b.line=192;d=a={h:"image.isLoaded",f:d,filename:"../nimx/image.nim",
line:0};a.line=192;d=a.f;c=!1;break a}while(0);d=b.f;return c}function rz(a){var c=a-1;c|=c>>>0>>>16;c|=c>>>0>>>8;c|=c>>>0>>>4;c|=c>>>0>>>2;return(c|c>>>0>>>1)+(1+(0>=a?1:0))}function sz(a){var c={h:"system_logger.logi",f:d,filename:"../nimx/system_logger.nim",line:0};d=c;c.line=31;console.log(Rm(fp[0].concat(Yp(a))));d=c.f}
function tz(a,c,b){var e=null,f={h:"image.getTextureQuad",f:d,filename:"../nimx/image.nim",line:0};d=f;a:do if(f.line=500,K(a.w,Gf)){f.line=204;d=e={h:"image.getTextureQuad",f:d,filename:"../nimx/image.nim",line:0};e.line=269;c=tz(a.spriteSheet,c,b);e.line=270;b[F(0,0,b.length+0-1)-0]=a.texCoords[F(0,0,a
yglukhov commented 5 years ago

To run the demo without the minifier, edit nakefile.nim and change disableClosureCompiler to true. But currently there's at least https://github.com/nim-lang/Nim/issues/9643 and https://github.com/nim-lang/Nim/issues/9644 which are the reasons. Maybe there's more...

timotheecour commented 5 years ago

hmm wondering whether --nilseqs:on vs --nilseqs:off would make these work ; if that's the case then at least we've narrowed down the problem happy to try if you tell me how to run the live web demo locally (I could also search for how to do that...)

yglukhov commented 5 years ago

hmm wondering whether

It will not work with --nilseqs:on because nimx code relies on the new non-nil-seqs semantics (

happy to try if you tell me how

To add nim flags, add the following to the nakefile:

beforeBuild = proc(b: Builder) =
    b.disableClosureCompiler = true
    b.additionalNimFlags.add "--nilseqs:on"
timotheecour commented 5 years ago

@yglukhov a root cause https://github.com/nim-lang/Nim/issues/9643 was just fixed, curious whether it helps for this issue

yglukhov commented 5 years ago

It works now with latest versions of everything.