-
Notifications
You must be signed in to change notification settings - Fork 383
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
TypeError: Cannot use 'in' operator to search for 'data' in null #125
Comments
I was also facing this issue. Downgrading to 1.2.2 solved the problem for me. My findings were that |
That solved it for me too! Thanks. |
I will look into the Handlebars' changelog to see what changed between 3.0.0 and 3.0.2. From what you're saying, it looks like semver was broken, which is unfortunate. Another way around this issue would be you add |
handlebars.js Issue 1003 was opened on that project and has a suggested workaround while this gets worked out. |
Sweet mother of Jesus, I have spent hours troubleshooting this issue... I thought I was going mad. Indeed, adding the workaround mentioned in handlebars.js Issue 1003 worked for me as well. What a pain! |
It looks like it is happening because of handlebars 3.0.2 which was being installed bundled with your package. I killed my node-modules and force loaded handlebars 3.0.1 ( npm install --save handlebars@3.0.1 ) then did a npm install and this seems to have resolved my problem. I spent a lot of time troubleshooting because it was only happening on my production box. What a pain. For some reason this page hasn't been indexed by google so it never showed up in a search. It would have saved me some headache. Bah! Just thought I would share a quick and easy fix that doesn't require mods to sources. |
Handlebars went through an ES6 conversation refactor that was released as a patch. There was a semantic change to `Handlebars.compileTemplate()` that caused Express Handlebars to break. The Handlebars maintainer was unwilling to fix the issue in Handlebars which pushed the problem upstream. In order to prevent any further upstream breakage, I'm addressing it here by replacing `null` with `undefined` for default values that are passed to Handlebars. See: handlebars-lang/handlebars.js#1003 Related discussion: handlebars-lang/handlebars.js@4bed826#commitcomment-10807064 Fixes: #125 #128
Release a guard against this in 2.0.1 |
Getting a bizarre error I've not seen before. The only change I made was the way Git handles line endings, but I doubt that would cause it. Using Express-handlebars v2.0.0 when I try to "res.render" I get the following:
The issue seems to be because line 124 is:
return this._compileTemplate(file, this.compilerOptions);
But
compilerOptions
is set tonull
here on line 31:compilerOptions: null,
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: