angular: angular2-polyfills.js: Uncaught TypeError: Cannot read property 'split' of undefined in

I am working through the Angular2 tutorial at https://angular.io/docs/ts/latest/quickstart.html and I am getting this error after starting the example with “npm start”

   angular2-polyfills.js:143 Uncaught TypeError: Cannot read property 'split' of undefined

The console shows no error. What is that?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 35 (10 by maintainers)

Most upvoted comments

Coming trought example today. I got it working. 😃

Only change in source I could found which breake my code was:

    "target": "ES5",

(With experiments I did set it to ES6.)

Error: declare.call is not a function Instantiating http://localhost:62571/angular2/platform/browser Loading http://localhost:62571/app/main.js Loading app/main at registerDeclarative (register-loader.js:327) at register-loader.js:236 at ZoneDelegate.invoke (angular2-polyfills.js:349) at Zone.run (angular2-polyfills.js:242) at angular2-polyfills.js:597 at ZoneDelegate.invokeTask (angular2-polyfills.js:382) at Zone.runTask (angular2-polyfills.js:282) at drainMicroTaskQueue (angular2-polyfills.js:500) at <anonymous>

----My app/main.ts----- `import { bootstrap } from ‘angular2/platform/browser’; import { AppComponent } from ‘./app.component’; import { enableProdMode } from ‘angular2/core’;

enableProdMode(); bootstrap(AppComponent); `

------index.html----- <core-min> <div><p>Please wait ;;;;;;;;;;</p></div> </core-min> <script> System.config({ packages: { 'app': { defaultExtension: 'js' } }, }); System.import('app/main').then(null, console.error.bind(console)); </script>

–app.component.ts— `import { Component } from ‘angular2/core’;

@Component({ selector: ‘core-min’, template: ‘

Welcome to .NET Core 1.0 + MVC6 + Angular 2

’ }) export class AppComponent { title = “here you are”; hero = “heroooo”; } ` any help would be appreciated