leshill / handlebars_assets

Use handlebars.js templates with the Rails asset pipeline.
MIT License
649 stars 159 forks source link

IE10 redeclaration of const error #126

Closed caosenorden closed 1 year ago

caosenorden commented 9 years ago

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.

AlexRiedler commented 9 years ago

@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 :)

carlosparamio commented 9 years ago

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.

AlexRiedler commented 9 years ago

@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).

carlosparamio commented 9 years ago

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 commented 9 years ago

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