0
votes

I try to start up my web app by 'ng serve', I get this error. Can't figure out why.

I am not really sure what the error is even telling me. I have tried to update all dependencies. I have looked at almost all the similar question solutions and they have not worked. I can't tell if it is a compiler error, typescript, or a dependency error.

[error] TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf () at Object.__extends (C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\node_modules\tslib\tslib.js:68:9) at C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\src\ngtsc\indexer\src\template.js:118:17 at C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\src\ngtsc\indexer\src\template.js:325:6 at C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\src\ngtsc\indexer\src\template.js:3:17 at Object. (C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\src\ngtsc\indexer\src\template.js:9:3) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Module.require (internal/modules/cjs/loader.js:1026:19) at require (internal/modules/cjs/helpers.js:72:18) at C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:21:22 at C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:10:17 at Object. (C:\Users\9090\Documents\project\FR\node_modules@angular\compiler-cli\src\ngtsc\indexer\src\transform.js:16:3) at Module._compile (internal/modules/cjs/loader.js:1138:30)

My package.json:

    {
  "name": "Client",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.1.0",
    "@angular-devkit/core": "^10.0.1",
    "@angular-devkit/schematics": "^10.0.1",
    "@angular/animations": "^8.2.14",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "^8.0.3",
    "@angular/compiler": "^8.0.3",
    "@angular/core": "^10.0.3",
    "@angular/forms": "^8.0.3",
    "@angular/material": "^7.3.7",
    "@angular/platform-browser": "^8.0.3",
    "@angular/platform-browser-dynamic": "^8.0.3",
    "@angular/router": "^8.0.3",
    "@fullcalendar/core": "^4.2.0",
    "@fullcalendar/daygrid": "^4.2.0",
    "@fullcalendar/interaction": "^4.2.0",
    "@fullcalendar/timegrid": "^4.2.0",
    "acorn": "^6.4.1",
    "agm-direction": "^0.7.9",
    "angular-fusioncharts": "^3.0.4",
    "bootstrap": "^4.4.1",
    "chart.js": "^2.8.0",
    "core-js": "^2.4.1",
    "events": "^3.0.0",
    "font-awesome": "^4.7.0",
    "fullcalendar": "^3.10.0",
    "hammerjs": "^2.0.8",
    "install": "^0.12.2",
    "jquery": "^3.5.1",
    "popper.js": "^1.12.9",
    "primeicons": "^1.0.0",
    "primeng": "^8.1.1",
    "quill": "^1.3.7",
    "rxjs": "^6.5.2",
    "rxjs-compat": "^6.0.0-rc.0",
    "save": "^2.4.0",
    "sweetalert": "^2.1.2",
    "sweetalert2": "^9.5.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.1000.1",
    "@angular/cli": "^10.0.1",
    "@angular/compiler-cli": "^10.0.3",
    "@angular/language-service": "^8.0.3",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "^6.0.118",
    "codelyzer": "^5.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^5.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^7.0.0",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~3.4.5"
  }
}
3
Can you write what node version you are using ?Bozhinovski
My node version v12.18.2Nir Amir

3 Answers

0
votes

I don’t think that the different angular package major versions will work together properly. Try updating all angular packages to a same major version. In WebStorm you use the syntax highlighting to gather the latest versions.

And try following in your project folder:

ng update

This will show you what to update exactly.

0
votes

first, check any node modules outdated by using the following command in your project folder,

npm outdated

The outdated command will list any packages that are not up to date

is there any outdated then upgrade these by using the command,

npm update --save/--save-dev
0
votes

Please update the rest of the dependencies. For example typescript is quite outdated. Try upgrading packages like "rxjs": "6.6.0", "typescript": "^3.9.6" etc.