"Cannot read property '3' of null" WebAppBuilder Custom Widget

1499
2
Jump to solution
02-02-2017 06:20 PM
Than_HtetAung
New Contributor II

Hi Guys,

I am getting this error message when it is calling a map service with esriRequest object in webappbuilder widget.

Below is the code snippet

 esriRequest({
   url: this.url,
   content: {
   f: 'json'
},
   handleAs: 'json'
}).then(lang.hitch(this, function (response) {
   console.log("successfully call");
}
this.emit('details-loaded', response);
}), lang.hitch(this,function(error){
   console.log("got error");
    console.log(error);
}));

Below is the error log

TypeError: Cannot read property '3' of null
at new f (https://js.arcgis.com/3.17/init.js:450:489)
at Object.c.urlToObject (https://js.arcgis.com/3.17/init.js:700:111)
at Object.c.getProxyUrl (https://js.arcgis.com/3.17/init.js:701:272)
at u (https://js.arcgis.com/3.17/init.js:859:368)
at e (https://js.arcgis.com/3.17/init.js:864:490)
at z (https://js.arcgis.com/3.17/init.js:871:60)
at Object._getServiceDetails (https://hseqmap.wde.woodside.com.au/map/widgets/HSEQMap/clusterfeaturelayer.js?wab_dv=2.1:241:17)
at Object.constructor (https://hseqmap.wde.woodside.com.au/map/widgets/HSEQMap/clusterfeaturelayer.js?wab_dv=2.1:235:22)
at Object.advice (https://js.arcgis.com/3.17/init.js:119:199)
at Object.c (https://js.arcgis.com/3.17/init.js:118:492)

Currently all the querytask, esrirequest and geometry task are failed to call or filter through map service. 

We are using the esri proxy in the builder also.

Would like to understand when will that error occur and what item map specifically causing this error?

Best Regards,

Than Htet Aung

0 Kudos
1 Solution

Accepted Solutions
Than_HtetAung
New Contributor II

Hi Yun,

I have fixed it by fixing proxy url in config.json file. Found out there is typo error in url.

==> Object.c.getProxyUrl 

So I will suggest, try to read from error stack and check one level by another.

Most of the time configuration has issue.

Best Regards,

Than

View solution in original post

0 Kudos
2 Replies
Yunpiao_WhitneyBai1
New Contributor

I have the same problem when I use esri boilerplate template and try to open the index html directly. But in the IDE environment, it works fine. 

Anyone knows to fix it?

Thanks

0 Kudos
Than_HtetAung
New Contributor II

Hi Yun,

I have fixed it by fixing proxy url in config.json file. Found out there is typo error in url.

==> Object.c.getProxyUrl 

So I will suggest, try to read from error stack and check one level by another.

Most of the time configuration has issue.

Best Regards,

Than

View solution in original post

0 Kudos