Skip to content
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: Access has been denied to resolve the property "statements" because it is not an "own property" of its parent. #1646

Closed
ramesh2611 opened this issue Jan 24, 2020 · 9 comments

Comments

@ramesh2611
Copy link

ramesh2611 commented Jan 24, 2020

I'm running my test case in locally with following versions
@angular-devkit/architect 0.803.23
@angular-devkit/core 8.3.23
@angular-devkit/schematics 8.3.23
@schematics/angular 8.3.23
@schematics/update 0.803.23
rxjs 6.4.0
Node: 12.14.1

handlers with the 4.5.3 versions i was getting my repost
coverage with old version

and recently i have verified my components and i have done npm install after this i have run the coverage then is was throwing error like:

           Handlebars: Access has been denied to resolve the property "statements" 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
Handlebars: Access has been denied to resolve the property "branches" 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
Handlebars: Access has been denied to resolve the property "functions" 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
Handlebars: Access has been denied to resolve the property "lines" 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

and report was generating but it looks like:
latest verison
and the latest version is 4.7.2

@wycats
@ kpdecker

@nknapp
Copy link
Collaborator

nknapp commented Jan 24, 2020

See #1636 please

@nknapp
Copy link
Collaborator

nknapp commented Jan 24, 2020

The basic answer is that istanbul-reports and many others are using Handlebars with custom classes as input. Which was not intended, documented or tested, but it still worked. Up to 4.5.3.

It was changed in 4.6.0 due to recurring security problems. Now prototype access is forbidden by default and opt-in via runtime options.

In your case, I believe you should ask the angular-people to bump to the a newer version of istanbul-reports, nyc or something in that direction. It had already been fixed.

@nknapp
Copy link
Collaborator

nknapp commented Feb 18, 2020

I have experienced this issue today as well. If upgrading you dependencies does not achieve the desired effect, try deleting and recreating your yarn.lock-file. That solved our problem today.

@nknapp nknapp closed this as completed Feb 18, 2020
@probfacile
Copy link

just try npm update istanbul-reports --depth 3 to check if it solve the issue for you.

@OTA-Panda
Copy link

just try npm update istanbul-reports --depth 3 to check if it solve the issue for you.

I liked this approach, but it didn't resolve my problem. After tracing the root package, I updated it and the errors went away:
npm list
searched for the instanbul-reports module then traced the root and updated:

npm install karma-coverage-istanbul-reporter@latest

@ashwingattani
Copy link

@sketchy-ota where did you install the karma-coverage-istanbul-reporter? inside istanbul-reports module?

@OTA-Panda
Copy link

@ashwingattani, after calling npm list in the terminal, I ran a word search in the terminal for instanbul-reports then traced the root module that depended on it, which in my case was the karma-coverage-istanbul-reporter (could be different for others possibly?).

So instead of trying to update just the dependency, I updated the whole library with '@latest', hence:
npm install karma-coverage-instanbul-reporter@latest

@ashwingattani
Copy link

@sketchy-ota, thanks for the update. for me, npm deep clean and npm update istanbul-reports --depth 3 worked in the end 🖖🏽

@sudip-mukherjee
Copy link

@sketchy-ota you saved my day buddy. this is working fine ( m using Linux 16.4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants