Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Our project is a Maven project and we are getting the following warnings while regression testing:



Handlebars: Access has been denied to resolve the property "statements" because it is not an "own property" of its parent.



In the documentation I read it can be overridden using runtime options like,



const template = handlebars.compile("{{aString.trim}}");
const result = template({ aString: " abc " });
// result is empty, because trim is defined at String prototype
const template = handlebars.compile("{{aString.trim}}");
const result = template(
{ aString: " abc " },
{
allowedProtoMethods: {
trim: true
}
}
);
// result = 'abc'



But not sure where to implement.
As the Yarn is automatically configured in POM.xml I cannot add the package @handlebars/allow-prototype-access as we cannot use manual yarn commands for it.

What I have tried:

we tried degrading the version of handlebars. The dependabot alerts on github wants the version 4.7.7 or higher so that is also not a possibility.
Also we tried installing the handlebars@allow-prototype but that requires the lower version and since it is automatically cofigured to pom.xml we can't seem to run manual commands.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900