title: Angular Updating New Version Error: TypeError: Object prototype may only be an Object or null: undefined
body: <p>I'm using angular template from <a href="https://github.com/aspnet/JavaScriptServices/" rel="nofollow noreferrer">.NET SPA Services</a>. So after updating the angular version 4.1.2 to 4.4.6 I guess server side pre-rendering is broking. It gives error :</p>
  
  <blockquote>
    <p>Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: Prerendering failed because of error: TypeError: Object prototype may only be an Object or null: undefined
        at setPrototypeOf (native)
        at <strong>extends (C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:74339:5)
        at C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:74357:5
        at C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:74386:2
        at Object.setPrototypeOf.__proto</strong> (C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:74313:10)
        at Object.c (C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:74316:2)
        at <strong>webpack_require</strong> (C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:20:30)
        at Object.setPrototypeOf.<strong>proto</strong> (C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:34187:203)
        at Object. (C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:34190:2)
        at <strong>webpack_require</strong> (C:\Users\doom\desktop\feasion\fso.web\fso.angularclient\ClientApp\dist\main-server.js:20:30)
    Current directory is: C:\Users\doom\desktop\feasion\fso.web\fso.angularclient</p>
    
    <p>at
    Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.d__7`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---</p>
  </blockquote>
  
  <p>And This is package.json</p>
  
  <pre><code>{
  
  
  "name": "feasionangular",
    "version": "0.1.2",
    "scripts": {    
      "test": "karma start ClientApp/test/karma.conf.js"
    },
    "dependencies": {
      "@angular/animations": "4.4.6",
      "@angular/cdk": "^2.0.0-beta.10",
      "@angular/common": "4.4.6",
      "@angular/compiler": "4.4.6",
      "@angular/core": "4.4.6",
      "@angular/forms": "4.4.6",
      "@angular/http": "4.4.6",
      "@angular/platform-browser": "4.4.6",
      "@angular/platform-browser-dynamic": "4.4.6",
      "@angular/platform-server": "4.4.6",
      "@angular/router": "4.4.6",
      "@angular/material": "^2.0.0-beta.10",
      "@angular/flex-layout": "^2.0.0-beta.9",
      "@types/node": "7.0.18",
      "angular2-jwt": "0.2.3",
      "angular2-moment": "1.7.0",
      "angular2-template-loader": "0.6.2",
      "aspnet-prerendering": "^2.0.5",
      "aspnet-webpack": "^1.0.29",
      "awesome-typescript-loader": "3.1.3",
      "bootstrap": "3.3.7",
      "css": "2.2.1",
      "css-loader": "0.28.1",
      "es6-shim": "0.35.3",
      "event-source-polyfill": "0.0.9",
      "expose-loader": "0.7.3",
      "extract-text-webpack-plugin": "2.1.0",
      "file-loader": "0.11.1",
      "hammerjs": "2.0.8",
      "html-loader": "0.4.5",
      "isomorphic-fetch": "2.2.1",
      "json-loader": "0.5.4",
      "jsrsasign": "8.0.3",
      "ngx-bootstrap": "1.9.3",
      "ngx-carousel": "1.2.0",
      "ngx-infinite-scroll": "0.5.1",
      "normalize.css": "^7.0.0",
      "preboot": "4.5.2",
      "raw-loader": "0.5.1",
      "reflect-metadata": "0.1.10",
      "rxjs": "5.4.2",
      "style-loader": "0.17.0",
      "to-string-loader": "1.1.5",
      "typescript": "2.3.2",
      "tslint": "5.8.0",
      "url-loader": "0.5.8",
      "webpack": "2.5.1",
      "webpack-hot-middleware": "2.18.0",
      "webpack-merge": "4.1.0",
      "zone.js": "0.8.10"
    },
    "devDependencies": {
      "@types/chai": "3.5.2",
      "@types/jasmine": "2.5.47",
      "chai": "3.5.0",
      "jasmine-core": "2.6.1",
      "karma": "1.7.0",
      "karma-chai": "0.1.0",
      "karma-chrome-launcher": "2.1.1",
      "karma-cli": "1.0.1",
      "karma-jasmine": "1.1.0",
      "karma-webpack": "2.0.3"
    }
  }
  </code></pre>
  
  <p>When I downgrade angular versions, the error is not throwing but I need to use newer versions.</p>