-1
Handlebars is returning this error to me every time I access the html page, it receives the values from the database but does not display. I’m using Mongo as a bank. Can you tell me if it’s some version error or if I’m doing something wrong?
" Handlebars: Access has been denied to resolve the Property "name" because it is not an "Own Property" of its Parent. You can add a Runtime option to disable the check or this Warning: See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for Details "
My route
router.get('/categorias', (req,res) => {
Categoria.find().then((categorias) => {
res.render('admin/categorias.handlebars',{categorias:categorias});
console.log(categorias);
}).catch((err) => {
req.flash('error_msg',"Houve um erro ao listar as categorias"+err);
res.redirect('http://localhost:8080/admin');
});
});
My html page
{{#each categorias}}
<div class="card mt-4">
<div class="card-body">
<h4>Nome: {{name}}</h4>
</div>
</div>
{{else}}
{{/each}}
Friend if possible comment your response and highlight the part that has been modified, this helps other people with the same doubt.
– LSA