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>
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
`-- [email protected]
`-- [email protected]
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';
You shouldn't add rxjs
special things in your system config. SystemJs supports node_modules
module lookups by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With