I am developing a widget and have gotten to the point where I want to test its deployment before I start work on the Setting page. The app that it's currently in (id=2) works properly. However, when I create a new app and try to add it, I get the dreaded "Load widget resource error". There is no message in the console indicating where it is failing.
I am using the steps outlined here on setting up widget development using Yeoman and Grunt. Any changes to my code is synchronized with the directories C:\WebAppBuilderForArcGIS\server\apps\2\widgets and C:\WebAppBuilderForArcGIS\client\stemapp\widgets.
I have gone through all the functions in my code and commented out everything. I have done the same with the Widget.html page and the Setting.js and Setting.html pages. I still get the error when attempting to add it to a new project. If I click OK on the message, then OK on the Settings page, when I open the widget, I get the same error message and nothing in the console.
Where do I begin tracking down the problem with the widget?
Ken,
Can you share your manifest.json and a screenshot of the widget directory with it's sub-directories expanded?
This is the manifest.json in the app (id=5) I'm trying to add it to
{
"name": "SpatialPrioritization",
"label": "Spatial Prioritization",
"2D": true,
"3D": false,
"platform": "HTML",
"version": "0.0.1",
"wabVersion": "2.5",
"author": "NCCOS",
"description": "A widget for Spatial Prioritization",
"copyright": "",
"license": "ISC",
"properties": {
"inPanel": true,
"hasLocale": true,
"hasStyle": true,
"hasConfig": true,
"hasUIFile": true,
"hasSettingPage": true,
"hasSettingUIFile": true,
"hasSettingLocale": true,
"hasSettingStyle": true,
"IsController": false
}
}
and the directories
Let me know if you are looking for something else
Ken,
Can you try and rename the setting folder to something other than setting and then change the manifest.json to have:
"hasSettingPage": false,
"hasSettingUIFile": false,
"hasSettingLocale": false,
"hasSettingStyle": false,
and test again.
I made those changes to the widget in the stemapp folder, created a new app, and tried to add the widget. It gives me the same error.
Ken,
Have you carefully checked to see if your widget.html has a nls string reference that you have not added in the string,js or may be miss-spelled?
I have commented everything out in the Widget.html and everything within all of the functions in Widget.js. There isn't anything that is attempting to use the strings.js file.
If I duplicate the original app where the widget works, the widget does work in the new app. I can open the Setting page with no error and the widget also opens with no error.
what about deleting the setting folder completely from the widget folder structure?
I deleted the setting folder and made sure the manifest.json had all the "hasSetting..." properties set at false in the client/widgets folder. I still get the error when creating a new app and attempting to add the widget.
Wow, this is strange. I not sure what to tell you then... It's like the stemApp widgets folder is not getting the latest version or something.