handlebars_assets icon indicating copy to clipboard operation
handlebars_assets copied to clipboard

IE10 redeclaration of const error

Open caosenorden opened this issue 9 years ago • 5 comments

Hi. I'm getting a IE10 "Redeclaration of const" error using latest version (0.20.1). It only happens when all my javascript code is compressed through out assets pipeline and in production mode. I checked and confirmed that the portion of code that provokes that is the following:

if (!window) { var window = {}; }

Thank you.

caosenorden avatar Apr 28 '15 08:04 caosenorden

@caosenorden that snippet of code is actually not in the latest release, was in a previously release but needed to be removed for a similar reason on IE. I have a feeling you might need to clear and recompile your assets.

If that doesn't work, feel free to post what other information you have :)

AlexRiedler avatar Apr 28 '15 14:04 AlexRiedler

I can see it at the current release: https://github.com/leshill/handlebars_assets/blob/v0.20.1/lib/handlebars_assets/handlebars.rb#L35

or master:

https://github.com/leshill/handlebars_assets/blob/master/lib/handlebars_assets/handlebars.rb#L35

Using version 0.20.1 here.

carlosparamio avatar Apr 28 '15 14:04 carlosparamio

@carlosparamio that part isn't actually sent to the browser; that is only used on the backend compile because there is no 'window' object (cause there is no browser).

AlexRiedler avatar Apr 28 '15 14:04 AlexRiedler

Sorry, you're right, we were running 0.20.0. I just tried on an empty Rails app using 0.20.1 and it wasn't there.

carlosparamio avatar Apr 28 '15 15:04 carlosparamio

It was a problem on a gemspec version miss match with Gemfile.lock, on the engine that required it. Thanks.

carlosparamio avatar Apr 28 '15 15:04 carlosparamio