Select to view content in your preferred language

Near Me widget breaks after saving

1000
11
09-06-2023 06:00 AM
ruikaitang_brampton
New Contributor II

I'm running into a very strange problem where I can add a Near Me widget to my app in ExB and it works flawlessly in the live preview when I add and configure it. However, if I save my app and refresh the page, or publish the app and view the published item, the widget breaks and no longer works. This is particularly confusing because it was working correctly a week or two ago, and I don't think I made any configuration changes since then to cause this.

I tried troubleshooting by looking at my console in Chrome, but didn't really find many threads on fixing the errors that were logged (see attached screenshot). The first two service worker errors occur even when the widget is working correctly, so I assume those are not critical, while the last geometry exception error only occurs when the widget stops working so I think that is the root of my problems.

ruikaitang_brampton_1-1694005037122.png

I am running ExB Developer Edition, but am trying this with just the default unmodified Near Me widget rather than the one I modified the assets/code for to eliminate the possibility that my customization is the cause of this issue.

0 Kudos
11 Replies
JeffreyThompson2
MVP Regular Contributor

The error seems to indicate that Near Me is trying to run a calculation on a missing geometry. Can you verify that all of the data sources are working properly? Does the error occur as soon as the page loads? If so, there is likely an issue with a React component loading before getting the data it requires.

GIS Developer
City of Arlington, Texas
0 Kudos
ruikaitang_brampton
New Contributor II

The data sources look like they're working properly in Map Viewer, and shouldn't have issues as they're currently being used in a production app. The app I'm working on is actually the ExB rebuild of the current WAB app, which uses the same layers and is functioning as intended right now.

The error doesn't occur on page load, it occurs when the widget is used (i.e. a pin is dropped to specify the location of interest). I think the most confusing part is that the widget works as intended in live preview, but throws the error and fails to work once saved/published.

0 Kudos
AzizaParveen1
Esri Contributor

Hi @ruikaitang_brampton,

I have few questions for you,

You mentioned you are using developer edition, did you try this in ArcGIS online version? If yes, do you see the same issue? Also, is it possible for you to share the feature service url with me? 

Thanks

Aziza

0 Kudos
ruikaitang_brampton
New Contributor II

Hi @AzizaParveen1 ,

I'm not sure how to load the full app into the ArcGIS online version, but I tried making a quick app and configuring the widget in an identical way and it seemed to work just fine with no issues.

There's a lot of feature layers being used, but I think I've narrowed down the problematic layer to one. Unfortunately that layer isn't available publicly, but it's a simple join of a layer with a table on where the "District_name" field in the table is used to join onto the "WARD" field of the polygon layer. The polygon layer and the table are both available to the public, and the URLs are provided below:

Polygon Layer: https://www.arcgis.com/home/item.html?id=61b3e12fb4d74d078a15512dc3baf568

Table: https://www.arcgis.com/home/item.html?id=699654b8f595400db0d8ae82b2108e92

0 Kudos
JeffreyThompson2
MVP Regular Contributor

I'd bet the join is your problem. Near Me is looking at the table and can't find the geometry on the other side of the join. Can you make a new feature layer with the table information included without using a join?

GIS Developer
City of Arlington, Texas
0 Kudos
ruikaitang_brampton
New Contributor II

I'm a bit confused by what you mean by this. The join is already its own feature layer that has the table information contained within it, I'm not sure how I would do this in a way without using a join other than manually entering the table data in to achieve an identical end product, which wouldn't fix anything.

The layer works perfectly fine in the ArcGIS Online version of ExB, but doesn't appear to work in the developer edition.

0 Kudos
JeffreyThompson2
MVP Regular Contributor

JeffreyThompson2_0-1694522504142.png

In ArcPro, if I join a feature class to table, I see the fields in the original table have their original names, but the joined table is nameOfOtherFeature.fieldName. This is because joining does not make a permanent connection. It points from one set of data to the other. I think Near Me is having problems "seeing over the dot". In ArcPro, it is possible to use the field calculator to save the data from the joined table into new fields in the original feature class and save the results. Thus creating a permanent relationship between the datasets. As for why it works in the ArcOnline Edition but not Developer Edition, it probably has something to do with where your featureLayer and table are stored making it easier for the ArcOnline to maintain the relationship. Copying the data from the table into the featureLayer would mean that Near Me would only have to look in one place for the data.  

GIS Developer
City of Arlington, Texas
0 Kudos
ruikaitang_brampton
New Contributor II

In that case I think the join I performed already copied the data from the both source layers into it's own new layer, and doesn't have the issue you are describing. You can see my fields for the layer of interest in the screenshot below.

ruikaitang_brampton_1-1694618894487.png

 

0 Kudos
AzizaParveen1
Esri Contributor

Thanks so much for narrow it down and sharing your data , we will take a look.

0 Kudos