reagent-project / reagent-template

A Leiningen template for projects using Reagent.
MIT License
394 stars 55 forks source link

Does not work with IE9 #44

Closed vipenzo closed 8 years ago

vipenzo commented 9 years ago

You just see a console error saying "ClojureScript could not load :main, did you forget to specify :asset-path?"

(same installation working with chrome)

yogthos commented 9 years ago

I don't actually have a windows machine to troubleshoot on. If you can figure what's happening with IE I'd love a pr for this.

vipenzo commented 9 years ago

The first problem I see has to do with the execution order of async scripts, it's described here http://stackoverflow.com/questions/94141/javascripts-document-write-inline-script-execution-order. Following one of the suggestions I modified app.js adding "defer" to every script: app.js:

if(typeof goog == "undefined") document.write('<script defer src="js/out/goog/base.js"></script>');
document.write('<script defer src="js/out/cljs_deps.js"></script>');
document.write('<script defer >if (typeof goog != "undefined") { goog.require("myapp.dev"); } else { console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?"); };</script>');

Now it goes one step forward but complains with method isDefAndNotNull not supported by goog at line 345 of base.js. This is strange since the function is defined later in the same file. I'm not able to understand it because I have no idea of how Closure is orchestrated. Is COMPILED supposed to be false ?

yogthos commented 9 years ago

I'm really not sure about this one. However, have you tried running production compiled version in IE9 to see if the same problem persists. If the compiled version works, then I would simply recommend not doing development using IE9.

vipenzo commented 9 years ago

I did an uberjar and run it from there, but it does not work (this time with a different error: SCRIPT438: object does not support isArray in app.js 24,289)

again I checked with chrome and it runs ok.

yogthos commented 9 years ago

Unfortunately, I'm really not sure what might be causing this. Typically, you'd end up with problems on IE9 when using Js features that it doesn't support, such as the console log. It might require some shims, you can see an example here. This might help resolve the issue.

lvh commented 9 years ago

As long as availability of IE is the issue, MS makes these available for free for precisely this purpose: http://dev.modern.ie/tools/vms/

They also have a thing called RemoteIE which apparently runs IE on an Azure box.

yogthos commented 9 years ago

I think the issue here is the effort required to debug IE9 as it provides very poor tooling. Practically speaking I simply wouldn't have the time for that.

Whoops commented 9 years ago

Plus your correct in that the React shim's are the fix for the isArray error. Perhaps they should be included in the template by default, but I'm not sure on that. I managed to write a fairly complex webapp that works fine in IE 9 without them, so I'm not sure what situations they are required in.

yogthos commented 9 years ago

I think the cookbook would probably be a better place for this.

yogthos commented 8 years ago

I'm going to close this one as IE9 has officially been deprecated, and I don't expect Reagent will support it going forward.