Issue with using a custom widget in Portal

3700
12
Jump to solution
09-13-2019 06:49 AM
Matheus_ViníciusRamos_da_Fonse
New Contributor III

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.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Matheus_ViníciusRamos_da_Fonse
New Contributor III

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.

View solution in original post

0 Kudos
12 Replies
RobertScheitlin__GISP
MVP Emeritus

Are there any errors in the browsers web console?

0 Kudos
Matheus_ViníciusRamos_da_Fonse
New Contributor III

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"

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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.

0 Kudos
Matheus_ViníciusRamos_da_Fonse
New Contributor III

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.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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?

0 Kudos
Matheus_ViníciusRamos_da_Fonse
New Contributor III

Yep. All of the files in the widget directory.
Could it be that i only need to config the CORS in my server?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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?

0 Kudos
Matheus_ViníciusRamos_da_Fonse
New Contributor III

Yeah, it is registered with the https url.

0 Kudos
Matheus_ViníciusRamos_da_Fonse
New Contributor III

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.

0 Kudos