question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception is thrown - Observable_1.Observable.fromEvent is not a function

See original GitHub issue

I’m submitting a … (check one with “x”)

[ ] bug report => error_handler.js:48EXCEPTION: Error in ./AppComponent class AppComponent - inline template:1:0 caused by: Observable_1.Observable.fromEvent is not a function

This bug is reproduced in https://github.com/marjan-georgiev/Angular-CLI-NG2D3-Demo

Current behavior Graph is rendered and bug is thrown in console.

Expected behavior Bug should not be thrown

Reproduction of the problem cloned the repo and run the app … Exception is thrown and shown in console

package.json - dependancies

“dependencies”: { “@angular/common”: “~2.2.3”, “@angular/compiler”: “~2.2.3”, “@angular/core”: “~2.2.3”, “@angular/forms”: “~2.2.3”, “@angular/http”: “~2.2.3”, “@angular/platform-browser”: “~2.2.3”, “@angular/platform-browser-dynamic”: “~2.2.3”, “@angular/router”: “~3.1.0”, “core-js”: “^2.4.1”, “d3”: “^4.2.2”, “d3-array”: “^1.0.1”, “d3-brush”: “^1.0.3”, “d3-color”: “^1.0.2”, “d3-force”: “^1.0.3”, “d3-format”: “^1.0.2”, “d3-hierarchy”: “^1.0.2”, “d3-interpolate”: “^1.1.1”, “d3-scale”: “^1.0.3”, “d3-selection”: “^1.0.2”, “d3-shape”: “^1.0.3”, “moment”: “^2.14.1”, “ng2d3”: “^1.6.2”, “rxjs”: “5.0.0-beta.12”, “ts-helpers”: “^1.1.1”, “zone.js”: “^0.7.1” }, “devDependencies”: { “@types/d3”: “^4.3.0”, “@types/jasmine”: “^2.2.30”, “@types/node”: “^6.0.42”, “angular-cli”: “1.0.0-beta.18”, “codelyzer”: “1.0.0-beta.1”, “jasmine-core”: “2.4.1”, “jasmine-spec-reporter”: “2.5.0”, “karma”: “1.2.0”, “karma-chrome-launcher”: “^2.0.0”, “karma-cli”: “^1.0.1”, “karma-jasmine”: “^1.0.2”, “karma-remap-istanbul”: “^0.2.1”, “protractor”: “4.0.9”, “ts-node”: “1.2.1”, “tslint”: “3.13.0”, “typescript”: “~2.0.3” }

Uploaded screenshot of the exception thrown

screen shot 2016-12-06 at 2 09 56 pm

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jeserkincommented, Jun 1, 2018

Having same issue with ngx-datatable and sorting. Should I create an issue in corresponding repository as well?

As I was able to find out, the issue with LongPressDirective. fromEvent is incorrectly imported. Could that be fixed? Thank you.

0reactions
mamallamacommented, Jul 18, 2019

ERROR TypeError: WEBPACK_IMPORTED_MODULE_1_rxjs_Observable.Observable.fromEvent is not a function at BarVerticalComponent…/src/common/base-chart.component.ts.BaseChartComponent.bindWindowResizeEvent (index.js:7220) at BarVerticalComponent…/src/common/base-chart.component.ts.BaseChartComponent.ngAfterViewInit (index.js:7135)

What’s going on? This is in Angular 7. I’ve attached my package.json file:

{ “name”: “app”, “version”: “0.0.0”, “scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e” }, “private”: true, “dependencies”: { “@angular/animations”: “~7.2.0”, “@angular/cdk”: “^7.2.1”, “@angular/common”: “~7.2.0”, “@angular/compiler”: “~7.2.0”, “@angular/core”: “~7.2.0”, “@angular/forms”: “~7.2.0”, “@angular/http”: “^7.2.15”, “@angular/material”: “^7.2.1”, “@angular/platform-browser”: “~7.2.0”, “@angular/platform-browser-dynamic”: “~7.2.0”, “@angular/router”: “~7.2.0”, “@fortawesome/fontawesome-free”: “^5.9.0”, “@swimlane/ngx-charts”: “^6.0.0”, “@swimlane/ngx-ui”: “^17.2.9”, “@types/arcgis-js-api”: “^4.11.0”, “@types/d3-shape”: “^1.3.1”, “bootstrap”: “^4.3.1”, “core-js”: “^2.5.4”, “d3”: “4.10.0”, “esri-loader”: “^2.9.2”, “hammerjs”: “^2.0.8”, “jquery”: “^3.4.1”, “lodash”: “^4.17.11”, “moment”: “^2.24.0”, “ngx-daterangepicker-material”: “^2.1.6”, “rxjs”: “6.3.3”, “rxjs-compat”: “6.3.3”, “tslib”: “^1.9.0”, “zone.js”: “~0.8.26” }, “devDependencies”: { “@angular-devkit/build-angular”: “~0.12.0”, “@angular/cli”: “~7.2.0”, “@angular/compiler-cli”: “~7.2.0”, “@angular/language-service”: “~7.2.0”, “@types/node”: “~8.9.4”, “@types/jasmine”: “~2.8.8”, “@types/jasminewd2”: “~2.0.3”, “codelyzer”: “~4.5.0”, “jasmine-core”: “~2.99.1”, “jasmine-spec-reporter”: “~4.2.1”, “karma”: “~3.1.1”, “karma-chrome-launcher”: “~2.2.0”, “karma-coverage-istanbul-reporter”: “~2.0.1”, “karma-jasmine”: “~1.1.2”, “karma-jasmine-html-reporter”: “^0.2.2”, “protractor”: “~5.4.0”, “ts-node”: “~7.0.0”, “tslint”: “~5.11.0”, “typescript”: “~3.2.2” } }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Observable.fromEvent is not a function - RxJS - Stack Overflow
Starting from RxJS@6 , fromEvent function is not a part of the Observable class, and instead, you need to use it directly from...
Read more >
Observable.fromEvent is not a function - ionic-v3
ERROR Error: Uncaught (in promise): TypeError: WEBPACK_IMPORTED_MODULE_2_rxjs_Observable.Observable.fromEvent is not a function
Read more >
spec-js/observables/fromEvent-spec.js | RxJS API Document
dist/package/Rx');; var Observable = Rx.Observable; ... it('should not throw an exception calling toString on obj with a null prototype', function (done) ...
Read more >
fromEvent | RxJS - Javascript library for functional reactive ...
( Observable ): An observable sequence of events from the specified element and the specified event. Example. Wrapping an event from jQuery. Using...
Read more >
[Solved]-Subscriber should not stop on error in observable-rx.js
Also note that any exception is rethrown if the subscriber doesn't have any error handler. For example to just avoid throwing an error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found