New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not find Observable.of #664

Closed
nathasm opened this Issue Mar 21, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@nathasm

nathasm commented Mar 21, 2016

Using latest node (5.6.X) with Chrome, I use Observable.of in one part of my code. The JS error console suggests that I submit an issue.

Failed to load resource: the server responded with a status of 404 (Not Found)
localhost/:96 Error: Error: XHR error (404 Not Found) loading http://localhost:5555/rxjs/add/observable/of.js(…) "Report this error at https://github.com/mgechev/angular2-seed/issues"(anonymous function) @ localhost/:96
@NathanWalker

This comment has been minimized.

Collaborator

NathanWalker commented Mar 21, 2016

Add this along with your other imports:

import {Observable} from 'rxjs/Observable';
@NathanWalker

This comment has been minimized.

Collaborator

NathanWalker commented Mar 21, 2016

If you still encounter issue, please provide link to Github repo with line number causing issue or provide your code inline here.

@nathasm

This comment has been minimized.

nathasm commented Mar 22, 2016

Modified app.component.ts from a fresh master checkout.

import {Observable} from 'rxjs/Observable';
import {Component} from 'angular2/core';
import {ROUTER_DIRECTIVES, RouteConfig} from 'angular2/router';
import {NavbarComponent} from './navbar.component';
import {ToolbarComponent} from './toolbar.component';
import {HomeComponent} from '../../home/components/home.component';
import {AboutComponent} from '../../about/components/about.component';
import {NameListService} from '../../shared/services/name-list.service';

@Component({
  selector: 'sd-app',
  viewProviders: [NameListService],
  moduleId: module.id,
  templateUrl: './app.component.html',
  directives: [ROUTER_DIRECTIVES, NavbarComponent, ToolbarComponent]
})
@RouteConfig([
  { path: '/',      name: 'Home',  component: HomeComponent  },
  { path: '/about', name: 'About', component: AboutComponent }
])
export class AppComponent {
  constructor() {
    Observable.of(1,2,3);
  }
}

screen shot 2016-03-21 at 8 19 23 pm

@NathanWalker

This comment has been minimized.

Collaborator

NathanWalker commented Mar 22, 2016

I'll take a look later. Last time I checked, 'of' worked fine with only importing Observable.

@NathanWalker NathanWalker reopened this Mar 22, 2016

@d3viant0ne

This comment has been minimized.

Contributor

d3viant0ne commented Mar 22, 2016

Go look at what is being imported.

Lines 11271 - 11374 of Rx.js - there is no require for "rxjs/add/operator/of"

This is a question best asked in an rxjs forum.

@nathasm

This comment has been minimized.

nathasm commented Mar 22, 2016

Correct, but adding import 'rxjs/add/operator/of' yields the error from my original post...I'm wondering do I need to add a mapping in systemJS somewhere so it can find the rest of the operators?

@d3viant0ne

This comment has been minimized.

Contributor

d3viant0ne commented Mar 22, 2016

No. Update to beta 3, the require statement is back in the Rx.js bundle
screen shot 2016-03-21 at 7 44 57 pm

@d3viant0ne

This comment has been minimized.

Contributor

d3viant0ne commented Mar 22, 2016

I'll bump the version in the seed when I get home

@mgechev

This comment has been minimized.

Owner

mgechev commented Mar 22, 2016

@nathasm the seed uses angular2 beta.9 (because of the zones issue), which depends on older version of rxjs.

Once the core team release beta.12 we'll update both rx and the angular version itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment