These are chat archives for AngularClass/angular2-webpack-starter

May 2016
Jyothi lakshmi R
May 11 2016 11:10

This error in Mozila :
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: missing token 'access-control-allow-headers' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).

This error is in Chrom:
XMLHttpRequest cannot load Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response.

i am not sure it origin mismatch or token not assigned in the header, i am not using oauth i just want to authenticate with server token provided by the uber api server.

this is my code:

getEstimatesForUserLocation (lat:number,lon:number) {

let endpoint = '';
let url  = `${endpoint}?latitude=${lat}&longtitude=${lon}`;
let headers = new Headers();

headers.append('Authorization', 'SERVER_TOKEN');//assigning my server token to header
headers.set('Access-Control-Allow-Origin', '*');
headers.append('Access-Control-Allow-Headers','x-requested-with, Content-Type, origin, authorization, accept, client-security-token');

return this.http.get(url, {headers})
  .map(res => res.json());


getEstimatesForUserLocation() {
this._countryService.getEstimatesForUserLocation(, this.long )
data=> this.row = data,
error =>this.error = "location" + + this.long + "invalid."


can any one please tell me server token which i am assigning here is correct?
note: i am using @angular/http package

May 11 2016 18:29
I am on beta 11 using this web pack starter...everything seemed to be working until last week... I recently started getting the following on my console
'//@ sourceURL' and '//@ sourceMappingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL=' instead. and a lot of them warnings whenever the application bootstraps
what should i do to avoid these warnings ( other than upgrading to latest release )
Colin Kearns
May 11 2016 18:43
I have got my project upgraded to RC 2 but the update must have broken something as I am now getting this error again: 90% optimize assetsError in bail mode: [default] /Users/Daily/Shortcut-Webpack/typings/browser/ambient/jquery/index.d.ts:3223:12 Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'. and I cannot figure out how I fixed it the first time, does anyone know?
Graham Churchley
May 11 2016 19:13
I'm using Karma to test my ng2 app. How do I force Karma to acquire plugins from the local [current] folder? I am seeing this debug message: Loading plugin C:\Program Files\nodejs\node_modules/karma-requirejs. Why is it looking in the "Program Files" folder?
Graham Churchley
May 11 2016 19:28
Fixed my Karma issue with regard to global plugins. I did
npm uninstall -g karma-requirejs
So now there is no global version and Karma picks the local version in the current folder. This is NOT how I would expect it to work. Surely the local folder should take precedence.