Select to view content in your preferred language

lang.hitch scope is null error while building widgets

2738
13
02-27-2019 09:48 AM
Rohit_Venkat_GandhiMendadhala3
Emerging Contributor

I am trying to build a widget which will retrieve the place links if we type an address or drop a pin at a location. It will provide links to Google 3D, Birdseye view. But when I start the server and import the widget in my application it shows up this error that widget cannot be created.  When I look into the console, it shows that lang. hitch scope is null. Here is the screenshot for your reference.

Tags (2)
0 Kudos
13 Replies
RobertScheitlin__GISP
MVP Emeritus

Rohit,

Look at the create widget error right above the lang.hitch issue. Line 117 of your Placelinks widget is where you need to focus your debugging efforts.

0 Kudos
Rohit_Venkat_GandhiMendadhala3
Emerging Contributor

Thank you very much Robert.

I checked the widgetmanger.js inside jimu.js folder

I think the line 117 is console.log('create [' + setting.uri + '] error:' + err.stack);

Is create[setting.uri] causing the issue?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rohit,

  Do you have a settings.js for this widget?

0 Kudos
Rohit_Venkat_GandhiMendadhala3
Emerging Contributor

Yes I do have it

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rohit,

  Try removing the whole settings folder from your widget and if your manifest.json has about hasSettingPage or hasSettingsUI set them to false and see if the issue goes away.

0 Kudos
Rohit_Venkat_GandhiMendadhala3
Emerging Contributor

Didn't work for me Robert. Can send you a zipped file if needed. Thank you

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rohit,

  At this point I do not know what else to tell you without seeing your code.

0 Kudos
Rohit_Venkat_GandhiMendadhala2
Occasional Contributor

Thanks Robert,

Can you share your email so that I can send the widget in a zipped file?

Appreciate your help. Thank you

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rohit,

  Sorry I only provide help online here and do not exchange emails. You can attach your widget to a reply when using the advanced editor.

0 Kudos