Base solution for your next web application
Open Closed

Cannot assign to a reference or variable! #5980


User avatar
0
rafalpiotrowski created

Can anyone help me with this error? I get this on all my pages after upgrade to 6.2 (upgraded from 5.6)

ERROR Error: Uncaught (in promise): Error: Cannot assign to a reference or variable! Error: Cannot assign to a reference or variable! at _AstToIrVisitor.push../node_modules/@angular/compiler/fesm5/compiler.js._AstToIrVisitor.visitPropertyWrite (compiler.js:15873) at PropertyWrite.push../node_modules/@angular/compiler/fesm5/compiler.js.PropertyWrite.visit (compiler.js:3318) at convertActionBinding (compiler.js:15551) at compiler.js:17127 at Array.forEach (<anonymous>) at ViewBuilder.push../node_modules/@angular/compiler/fesm5/compiler.js.ViewBuilder._createElementHandleEventFn (compiler.js:17123) at nodes.(anonymous function) (http://localhost:4200/vendor.js:30612:23) at compiler.js:17085 at Array.map (<anonymous>) at ViewBuilder.push../node_modules/@angular/compiler/fesm5/compiler.js.ViewBuilder._createNodeExpressions (compiler.js:17084) at _AstToIrVisitor.push../node_modules/@angular/compiler/fesm5/compiler.js._AstToIrVisitor.visitPropertyWrite (compiler.js:15873) at PropertyWrite.push../node_modules/@angular/compiler/fesm5/compiler.js.PropertyWrite.visit (compiler.js:3318) at convertActionBinding (compiler.js:15551) at compiler.js:17127 at Array.forEach (<anonymous>) at ViewBuilder.push../node_modules/@angular/compiler/fesm5/compiler.js.ViewBuilder._createElementHandleEventFn (compiler.js:17123) at nodes.(anonymous function) (http://localhost:4200/vendor.js:30612:23) at compiler.js:17085 at Array.map (<anonymous>) at ViewBuilder.push../node_modules/@angular/compiler/fesm5/compiler.js.ViewBuilder._createNodeExpressions (compiler.js:17084) at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:13842) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:595)


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @rafalpiotrowski

    I couldn't understand the problem actually but most of the time those problems are related to tooling and installed version of packages.

    So, I suggest you to remove node_modules folder and do a clean installation using yarn. If that doesn't work try to upgrade node version and angular-cli version globally.

  • User Avatar
    0
    rafalpiotrowski created

    which version of node should I use? 10.13.0 LTS or 11.2.0 Current?

  • User Avatar
    0
    rafalpiotrowski created

    PS C:\Users\merlin\source\repos\PlasticsTrader\angular> yarn yarn install v1.12.3 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "win32" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > @angular/[email protected]" has incorrect peer dependency "@angular/core@>=6.0.0-beta.0 <7.0.0". warning " > @angular/[email protected]" has incorrect peer dependency "@angular/common@>=6.0.0-beta.0 <7.0.0". warning " > @ng-bootstrap/[email protected]" has incorrect peer dependency "@angular/common@^6.1.0". warning " > @ng-bootstrap/[email protected]" has incorrect peer dependency "@angular/core@^6.1.0". warning " > @ng-bootstrap/[email protected]" has incorrect peer dependency "@angular/forms@^6.1.0". warning " > @swimlane/[email protected]" has incorrect peer dependency "@angular/[email protected]". warning " > @swimlane/[email protected]" has incorrect peer dependency "@angular/[email protected]". warning " > @swimlane/[email protected]" has incorrect peer dependency "@angular/[email protected]". warning " > @swimlane/[email protected]" has incorrect peer dependency "@angular/[email protected]". warning " > [email protected]" has incorrect peer dependency "@angular/core@^6.0.0". warning " > [email protected]" has incorrect peer dependency "@angular/common@^6.0.0". warning " > [email protected]" has incorrect peer dependency "@angular/common@^6.0.0". warning " > [email protected]" has incorrect peer dependency "@angular/core@^6.0.0". warning " > [email protected]" has incorrect peer dependency "@angular/core@^6.0.0". warning "@angular-devkit/build-angular > @ngtools/[email protected]" has incorrect peer dependency "typescript@~2.4.0 || ~2. 5.0 || ~2.6.0 || ~2.7.0 || ~2.8.0 || ~2.9.0". warning " > [email protected]" has incorrect peer dependency "@angular/compiler@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0". warning " > [email protected]" has incorrect peer dependency "@angular/core@>=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0". warning " > [email protected]" has incorrect peer dependency "jasmine-core@>=3.2". [###################--------------------------------------------------------------------------------------] 17003/92906

  • User Avatar
    0
    rafalpiotrowski created

    compilation worked and the application starts

    problem arrive when I try to open any of my own components

  • User Avatar
    0
    rafalpiotrowski created

    chunk {styles} styles.js, styles.js.map (styles) 574 kB [initial] [rendered] chunk {vendor} vendor.js, vendor.js.map (vendor) 10.7 MB [initial] [rendered] chunk {1047} 1047.js, 1047.js.map () 10.1 kB [rendered] i 「wdm」: Compiled successfully.