So, i made a custom widget and added it into Portal as a Web App Builder Extension by using the manifest.json URL. It seems to be a successful deploy, as it even shows up in my Web App Builder, in the custom widget tab, but upon clicking "OK" after selecting my custom widget, nothing happens. Nothing.
I can add normal pre-built widgets just fine, it's just my widget that won't work.
Solved! Go to Solution.
I have solved the issue by adding a web.config file to the widget's root folder containing the CORS configuration settings. It works just fine now.
Are there any errors in the browsers web console?
Yes, now that you've mentioned it. It's a warning about CORS, saying the header isn't present, and another log message that reads: "No widget is selected. Unable to load https://portalURLhere.com/WidgetFolder/manifest.json"
That sounds like you have not registered the widget with the proper path. It should not be looking for the widgets manifest.json in the root of the portal url.
That was just a generic url i typed in, the widget file is properly mapped inside the server, as i can browse its contents externally via URL. I have edited my previous response as to avoid confusion.
So when you click on the url link in the browsers error message it is able to navigate a show the contents for the widgets manifest.json?
Yep. All of the files in the widget directory.
Could it be that i only need to config the CORS in my server?
I am not a Portal user but yes it sounds like the request is being blocked do to the cors error. Did you register the widget using the https url?
Yeah, it is registered with the https url.
I have solved the issue by adding a web.config file to the widget's root folder containing the CORS configuration settings. It works just fine now.