-
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
Handlebars 4.6.0+ breaks some functionality within Express-Handlebars; any way to run runtime options? #275
Comments
Second this, adding runtime options throws. I've been trying to use |
This is an issue, for all that are or will using (express-)handlebars in the newest versions. As for my self I upgraded my kubuntu to 19.10 and with mongodb 3.6 I have had to update my npm resources because of mongoose. So with the updated express-handlebars and everything I now have the trouble of my software, based on express-handlebars, is not working anymore. |
This fix referenced here is a temporary workaround. This fix was created as a fix to express-handlebars by the creators of handlebars. |
interesting approach its a good way to revert the breaking changes, that way its update-save. But I would really like to see an implementation of runtime options into express-handlebars so we can have the security buff the changes of handlebars brings. |
ok, here is an other approach: we can use the _renderTemplate hook quiet easily.
worked for me or did I missed something? |
how to implement this on express?? i have this code:
|
Try the following:
Should be something like that, have not tested it but you should get the gist of it. Would also be possible to do everything within the ""app.engine('.hbs', hbs({"" block but I would have to test it. Also, are you sure that
is correct? |
There are new access restrictions on Objects within Handlebars since 4.6 which was released in early January 2020. The only way to ignore these new restrictions is to include runtime options to ignore them, which express-handlebars doesn't support. Is there any plan to update so that exphbs allows for runtime options?
handlebars-lang/handlebars.js#1633
https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access
Baring that, does anyone know of a method to force exphbs to use a specific version of Handlebars (namely 4.5.3, which is the most recent revision before these new restrictions went into effect.)
The text was updated successfully, but these errors were encountered: