Select to view content in your preferred language

Custom Widget error: net::ERR_ABORTED 404 (Not Found), when deployed to ArcGIS Portal

507
0
12-08-2023 03:35 PM
dsanchez80
New Contributor

Hey community, have a good day

I am struggling trying to run a deployed custom widget in ArcGIS Portal, getting 404 Error when running it in the viewer.

In development env it works fine, no error and runs perfectly, but it seems something with path references to a custom .js file when move it to portal server.

Here is my widget directory/file structure in development:

dsanchez80_0-1702077111075.png

CustomDrawSymbolChooser.js is a copy from jimu.js\dijit\SymbolChooser.js and customized according to some requirements. I put this file into my custom widget's directory root (as you can see)

CustomDrawSymbolChooser.html is a copy from jimu.js\dijit\templatesSymbolChooser.html and customized same way. Put it also in the widget root directory.

Following is the way how I reference both in Widget.html and Widget.js

Widget.html:

dsanchez80_1-1702077415195.png

Widget.js:

dsanchez80_2-1702077466302.png

Besides that, I define the CustomDrawSymbolChooser.html template in CustomDrawSymbolChooser.js this way (and also the config.json file i require):

CustomDrawSymbolChooser.js:

dsanchez80_3-1702077621801.png

 

The development and the widget runs perfectly fine in my local environment, no issues or errors. But when I deploy it in arcgis portal and run it in Viewer, there is an error 404 

dsanchez80_4-1702078126589.png

After some error search I found it might be a path reference problem but I have changed every possible invoke path in Widget.html to the CustomDrawSymbolChooser.js file:

dsanchez80_5-1702078256504.png

data-dojo-type="Draw/CustomDrawSymbolChooser"

data-dojo-type="./Draw/CustomDrawSymbolChooser"

data-dojo-type="./CustomDrawSymbolChooser"

But none of them working. Always "tries" to readdress to ../portal/jsapi/jsapi/dojo/... directory and it doesnt have anything to do with my widget development, I dont know why I tries to call that path.

Please, appreciate any help as you will understand it goes beyond the development and I dont what else to do at this point.

PS: My custom widget is deployed in C:\inetpub\wwwroot and then add it via Portal without issues. It is when running the widget that the error shows up.

Thank you guys!

 

 

 

 

0 Kudos
0 Replies