RxJS root directory Not Found by SystemJS

Viewed 6533

SystemJS appears to load rxjs modules without an issue but throws a 404 Not Found on the rxjs directory itself. All modules are the latest version and this only appears to be an issue on Windows, it works on osx.

GET http://localhost:8080/node_modules/rxjs/ 404 (Not Found)

Error: Error: XHR error (404 Not Found) XHR finished loading: GET " localhost:8080/node_modules/rxjs/Subject.js".

XHR finished loading: GET "localhost:8080/node_modules/rxjs/operator/toPromise.js".

Module loads & Error

<script>
    System.config({
        packages: {
            app: {
                format: 'register',
                defaultExtension: 'js',

            },
            'components':{ format: 'register' },
            'rxjs': {defaultExtension: 'js'}
        },
        map: {'app': '/components',
            'rxjs': '../node_modules/rxjs',
            },


    });
    System.import('components/notes.js')
            .then(null, console.error.bind(console));
</script>

+-- angular2@2.0.0-beta.9
+-- bootstrap@3.3.6
+-- es6-promise@3.0.2
+-- es6-shim@0.33.3
+-- jquery@2.2.1
+-- reflect-metadata@0.1.2
+-- rxjs@5.0.0-beta.2
+-- systemjs@0.19.24
| +-- es6-module-loader@0.17.11
| `-- when@3.7.7
+-- typescript@1.8.7
`-- zone.js@0.5.15
  `-- es6-promise@3.1.2

I fixed this, it seems the way I was importing rxjs in my .ts was deprecated:

changed from

import {Subject, Observable} from 'rxjs';

to:

import { Observable } from 'rxjs/Observable'; import { Subject } from 'rxjs/Subject'; import { map } from 'rxjs/operator/map';

2 Answers
Related