Angular-cli: Uncaught TypeError: Cannot read property 'apply' of undefined common.es5.js

Created on 24 May 2017  路  12Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Windows 7 Professional
@angular/cli: 1.0.4
node: 6.10.3
os: win32 x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.4
@angular/compiler-cli: 4.1.3

Repro steps.

npm -v
3.10.10

node -v
v6.10.3

npm install -g @angular/cli
ng new Angular4
cd Angular4
ng serve

The log given by the failure.

ng serve does not throw errors. But browser has following error:

Uncaught TypeError: Cannot read property 'apply' of undefined
combine @ common.es5.js:3091
ENTITIES @ common.es5.js:2941
__webpack_require__ @ bootstrap 6518a66546b9401e7158:52
module.exports @ http.es5.js:2185
__webpack_require__ @ bootstrap 6518a66546b9401e7158:52
webpackJsonp.104 @ src async:7
__webpack_require__ @ bootstrap 6518a66546b9401e7158:52
webpackJsonp.243 @ main.bundle.js:160
__webpack_require__ @ bootstrap 6518a66546b9401e7158:52
webpackJsonpCallback @ bootstrap 6518a66546b9401e7158:23
(anonymous function) @ main.bundle.js:1

Desired functionality.

I would like to run a sample application provided in https://cli.angular.io/

Mention any other details that might be useful.

This is a fresh start. This system had no node/npm/Angular/CLI installed before.
low regression bufix

Most helpful comment

I have same issue in ie11 and chrome. firefox is well.

All 12 comments

i have same issue in ie11 only

image

I have same issue in ie11 and chrome. firefox is well.

Few more details:
Chrome Version 44.0.2403.157 m.
IE Version 11.0.9600.18638CO

This error occurs even when upgrading from Angular 2

I've just encountered this also.
Seems to be browser version dependent,
Serving a prod build from single web server.
browser running Chrome 44.0.2403.107 has problem
browser running Chrome 48.0.2546.97 ran it fine

Hi, just checking to see if there's any update on the issue...

I would also be interested in any update

Any update on that?

Anyone come up with a workaround?

Same problem.Is anyone solved now?

Angular CLI: 1.6.6
Node: 9.2.1
OS: darwin x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

@angular/cdk: 5.1.0
@angular/cli: 1.6.6
@angular/flex-layout: 2.0.0-beta.10-4905443
@angular/material: 5.1.0
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@schematics/angular: 0.1.17
typescript: 2.6.1
webpack: 3.10.0

Just started seeing this error on Chrome 63.03239. Only shows with prod build.

main.0df4f12bc48121b66222.bundle.js:1 ERROR TypeError: Cannot read property 'apply' of undefined
at e.project (main.0df4f12bc48121b66222.bundle.js:1)
at e._next (main.0df4f12bc48121b66222.bundle.js:1)
at e.next (main.0df4f12bc48121b66222.bundle.js:1)
at e._next (main.0df4f12bc48121b66222.bundle.js:1)
at e.next (main.0df4f12bc48121b66222.bundle.js:1)
at e.next (main.0df4f12bc48121b66222.bundle.js:1)
at e._next (main.0df4f12bc48121b66222.bundle.js:1)
at e.next (main.0df4f12bc48121b66222.bundle.js:1)
at n.observe (main.0df4f12bc48121b66222.bundle.js:1)
at e.dispatch (main.0df4f12bc48121b66222.bundle.js:1)

Interestingly Firefox 59.0b4 shows the following instead -

ERROR
TypeError: c.a.merge is undefined
Stack trace:
fn/http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:1264165
5jKg/r_next@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:196719
E9/g/anext@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:337931
E9/g/a_next@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:338248
E9/g/anext@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:337931
TO51/cnext@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:1002683
E9/g/a_next@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:338248
E9/g/anext@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:337931
PAZ8/oobserve@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:646762
YRqN/rdispatch@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:1191340
GTlS/u_execute@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:391880
Gcw1/oexecute@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:393145
wclm/iflush@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:7661648
Gcw1/oschedule@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:393018
wclm/oschedule@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:7661263
cDNt/onhttp://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:1262146
eFQL/invoke@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:44995
eFQL/run@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:40149
cDNt/onschedule@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:1262114
YRqN/rscheduleMessage@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:1191447
YRqN/r_next@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:1191552
E9/g/anext@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:337931
PAZ8/oobserve@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:646762
Bu8b/sdispatch@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:308187
GTlS/u_execute@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:391880
GTlS/uexecute@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:391696
wclm/iflush@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:7661648
eFQL/invokeTask@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:45670
onInvokeTask@http://localhost:8080/main.31c90e2b90310b432853.bundle.js:1:508447
eFQL/invokeTask@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:45583
eFQL/runTask@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:40840
eFQL/invokeTask@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:46784
e/this.invoke<@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:46666
c/n.args[0]@http://localhost:8080/polyfills.75d6e1366e9ec579513e.bundle.js:1:62984

I tried running a CLI app created with the latest CLI version on IE 11 and could get it to run.

These are the important things you should do:

  • If you need to support IE11, make sure to uncomment the polyfills in ./src/polyfills.ts for the IE version you need.
  • Depending on the version of Angular CLI you use, some of the performance optimizations might not work on older browsers when running ng serve. These optimizations don't affect ng build as they are only meant for debugging during development.

To use a different server to serve the contents of dist/, you can install http-server:

  • npm install -g http-server
  • ng build
  • http-server dist/ (this serve the dist folder on http://localhost:8080/).

Although this is somewhat bothersome, it's not that common that developers use IE11 to debug their apps so we think the reduced rebuild time on ng serve is worth it.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings