Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handlebars.default results in errors in IE8 #824

Closed
parris opened this issue Jul 17, 2014 · 8 comments
Closed

Handlebars.default results in errors in IE8 #824

parris opened this issue Jul 17, 2014 · 8 comments
Labels
Milestone

Comments

@parris
Copy link

parris commented Jul 17, 2014

Basically you need to use Handlebars['default'] to be safe not to break every browser.

defaultis a reserved word in JS. It might be a) either worth mentioning in the docs or b) worth renaming.

@kpdecker
Copy link
Collaborator

Where are you seeing this?

@frankdejonge
Copy link

I have this issue too. I'm using browserify with hbsfy to compile my hbs templates. The resulting source generates the something.default, which leads to an error. It happens when you pre-compile the templates.

@frankdejonge
Copy link

@kpdecker if you want I can setup an example?

@parris
Copy link
Author

parris commented Aug 8, 2014

I see this whenever I use the dot notation to access default. Using square
brackets works fine. If a compiler transforms brackets to dot notation
you'd also see this problem.
On Aug 8, 2014 7:47 AM, "Frank de Jonge" notifications@github.com wrote:

@kpdecker https://github.com/kpdecker if you want I can setup an
example?


Reply to this email directly or view it on GitHub
#824 (comment)
.

@parris
Copy link
Author

parris commented Aug 8, 2014

Specifically if I attempt to create a helper.
On Aug 8, 2014 8:45 AM, "Parris Khachi" parris@letswoosh.com wrote:

I see this whenever I use the dot notation to access default. Using square
brackets works fine. If a compiler transforms brackets to dot notation
you'd also see this problem.
On Aug 8, 2014 7:47 AM, "Frank de Jonge" notifications@github.com wrote:

@kpdecker https://github.com/kpdecker if you want I can setup an
example?


Reply to this email directly or view it on GitHub
#824 (comment)
.

@frankdejonge
Copy link

@parris if you're using Gulp.js, I use gulp-replace with this to fix it:

.pipe(replace(".default.", "['default']."))

@kpdecker
Copy link
Collaborator

Yes, default is a reserved word in some of the older environments. I've added a FAQ entry regarding this.

For the hbsfy specific issue, you'll need to raise that with that specific project.

@kpdecker
Copy link
Collaborator

Released in v2.0.0-beta.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants