Issue with using a custom widget in Portal

518
10
Jump to solution
09-13-2019 06:49 AM
Labels (1)
Highlighted
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)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
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

Reply
0 Kudos
10 Replies
Highlighted
MVP Esteemed Contributor

Are there any errors in the browsers web console?

Reply
0 Kudos
Highlighted
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"

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

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.

Reply
0 Kudos
Highlighted
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.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

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?

Reply
0 Kudos
Highlighted
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?

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

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?

Reply
0 Kudos
Highlighted
New Contributor III

Yeah, it is registered with the https url.

Reply
0 Kudos
Highlighted
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

Reply
0 Kudos