So I have a project I am working on that needs me to use ng build --prod
to build a client. When I run ng build --prod
I get the same error every time:
ERROR in Cannot read property 'kind' of undefined
This error occurs every time and no matter what I do, I cannot seem to get the client to build properly after nearly a week wrestling with it, and days searching for a solution. I have attached a git link to the client in hopes someone will be able to find and fix this error. To run this, just npm install
in the Cube folder in the location you've downloaded it, then run ng build --prod
. My hope is that this is an easy fix.
Github link to install the client:
https://github.com/detis46901/Cube.git
EDIT 1: I have looked at other questions on StackOverflow, such as the one listed in the comment below (TypeError: Cannot read property 'kind' of undefined at getAssignmentTargetKind). These solutions do not seem to work.
So I found the solution. I had to go in and edit the tsconfig.json.
Under "angularCompilerOptions"
I had to add "enableIvy": false
.
Under "lib"
I had to add "ES2020"
as well as "ESNext"
.
Once I had done that, I then needed to rm ./node_modules/
and then npm i
. Then, I had to install specific versions of typescript and angular.
npm install typescript@3.6
npm install @angular-devkit/built-angular@0.901.9
npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4
With these changes I was finally able to ng build
the client. I will let the original github owner know what needs to change so that the program can be better used.