Handlebars: Access has been denied to resolve the property "title" because it is not an "own property" of its parent. You can add a runtime option to disable the check or this warning: See http://localhost:8080/api-reference/runtime-options.html#options-to-control-prototype-access for details Handlebars: Access has been denied to resolve the property "description" because it is not an "own property" of its parent.
Asked
Active
Viewed 1,170 times
0
-
[Check this answer](https://stackoverflow.com/a/59721333/9370788) and have fun! – Drozerah Jan 27 '20 at 22:27
3 Answers
2
// Idea Index Page
app.get('/ideas', (req, res) => {
Test1.find({})
.sort({date:'desc'})
.lean()
.then(ideas => {
res.render('ideas/index', {
ideas1: ideas
});
});
});
use .lean()
and it works properly.

H Hassanshahi
- 101
- 1
- 3
0
download the package npm install @handlebars/allow-prototype-access
and import this to your app.js
const {allowInsecurePrototypeAccess} = require('@handlebars/allow-prototype-access')
and to app.engine()in your app.js use this syntax:
app.engine('handlebars', exphbs({ defaultLayout: 'main', handlebars: allowInsecurePrototypeAccess(Handlebars) },
));
app.set('view engine', 'handlebars',);

Ngirimana Safari Schadrack
- 87
- 1
- 8