question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot assign to read only property 'tView' of object '[object Object]' with Ivy

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/core

Is this a regression?

Yes, the previous version in which this bug was not present was: 8.2.14

Description

I have upgrade from latest v8.2.14 to v9 rc11 and I have this error, it seems that tView property is created as non-writtable…

πŸ”¬ Minimal Reproduction

πŸ”₯ Exception or Error

image


core.js:5809 ERROR TypeError: Cannot assign to read only property 'tView' of object '[object Object]'
    at getOrCreateTComponentView (core.js:11800)
    at createRootComponentView (core.js:25350)
    at ComponentFactory$1.create (core.js:32855)
    at ViewContainerRef.createComponent (core.js:15150)
    at RouterOutlet.activateWith (router.js:8939)
    at RouterOutlet.ngOnInit (router.js:8846)
    at callHook (core.js:3873)
    at callHooks (core.js:3837)
    at executeInitAndCheckHooks (core.js:3778)
    at refreshView (core.js:11586)

🌍 Your Environment

Angular Version:


Angular CLI: 9.0.0-rc.10
Node: 13.0.1
OS: linux x64

Angular: 9.0.0-rc.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.0-rc.10
@angular-devkit/build-angular     0.900.0-rc.10
@angular-devkit/build-optimizer   0.900.0-rc.10
@angular-devkit/build-webpack     0.900.0-rc.10
@angular-devkit/core              8.3.23
@angular-devkit/schematics        8.3.23
@angular/cdk                      8.2.3
@angular/cli                      9.0.0-rc.10
@angular/localize                 9.0.0-rc.0
@ngtools/webpack                  9.0.0-rc.10
@schematics/angular               9.0.0-rc.10
@schematics/update                0.900.0-rc.10
rxjs                              6.5.4
typescript                        3.6.5
webpack                           4.41.2
    
Done in 0.42s.

Anything else relevant? It works if I disable Ivy

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
AndrewKushnircommented, Feb 6, 2020

Hi @tonivj5, thanks for additional information and a repro. I performed further investigation and it turned out that Ngrx freezes actions recursively, which also freezes Ivy defs generated by compilers. As a result, Ivy runtime fails to write to component def. I left more detailed reply in https://github.com/ngrx/platform/issues/2109#issuecomment-582689060.

There are no action items on framework side atm, so I will close this ticket and continue discussion in the mentioned thread in Ngrx repo.

Thank you.

0reactions
angular-automatic-lock-bot[bot]commented, Mar 14, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typeError: Cannot assign to read only property 'tView' of object ...
This is a problem with NGRX Store and Ivy runtime which began in Angular 9. The problem is best explained here: ...
Read more >
typeError: Cannot assign to read only property 'tView' of object ...
TypeError : Cannot assign to read only property 'tView' of object '[object ... This is a problem with NGRX Store and Ivy runtime...
Read more >
ngrx/store - Gitter
im receiving an error: TypeError: Cannot assign to read only property 'macroTask' of object '#<Object>'. when im trying to do this this.store.dispatch(new ...
Read more >
Angular Ngxs Typeerror: Cannot Freeze - ADocLib
TypeError : Cannot assign to read only property 'tView' of object '[object Object]' private Angular fields/API might be excluded from freeze operation. false ......
Read more >
Template type checking - Angular
Just as TypeScript catches type errors in your code, Angular checks the expressions ... user is a property on the component class; user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found