Select to view content in your preferred language

FeatureLayer with labelingInfo causes crash in ArcGIS JS 4.33

295
5
Tuesday
CharanpreetKaur
Emerging Contributor

I’m using the ArcGIS Maps SDK for JavaScript (v4.33) within a React application, where I dynamically create layers with custom renderers and label configurations. I recently upgraded my application from v4.30 (where everything functioned correctly) to v4.33.

The issue:

  • Layers that have no labelingInfo on the server work fine.

  • But whenever a layer has labelingInfo defined on the server side, my app crashes with the following error:

 

CharanpreetKaur_0-1755665092510.png


Question:

  • Is this a known issue with labelingInfo + renderers in v4.33?

  • Am I missing a required property in the labelingInfo definition?

  • Is there a way to tell the API to ignore server-side labelingInfo (or safely override it with an empty labelingInfo  : []) when creating a FeatureLayer?
0 Kudos
5 Replies
Noah-Sager
Esri Regular Contributor

Hi @CharanpreetKaur, thanks for posting your question here. There should not be an issue with labeling at 4.33 with a React app, but it's difficult to diagnose from the above information.

If you open the browser Developer Tools, do you see any warning or error messages in the Console?

Can you create a simplified reproducible test-app that demonstrates this issue with and without React?

Lastly, there were some breaking changes between version 4.30 and 4.33, you might want to review the changes and see if the app needs to be updated: https://developers.arcgis.com/javascript/latest/breaking-changes/

 

0 Kudos
CharanpreetKaur
Emerging Contributor

Hi @Noah-Sager,

Thanks for your response. Below are some additional details:

Service URLhttps://abc.com/server/rest/services/abc/AdminBoundaries/FeatureServer/1

Labeling Info:
I’ve attached a screenshot showing how labeling info is being passed.

I noticed that in layers where the labeling info is empty under Drawing Info, there is no issue. However, when labeling info is present (as shown in the screenshot), the website crashes (as shared in my original post).

CharanpreetKaur_2-1755757057693.png

CharanpreetKaur_3-1755757082806.png

Console Warnings before crash:

Multiple versions of Lit loaded. Loading multiple versions is not recommended. See https://lit.dev/msg/multiple-versions for more information.
GVH7TFSD.js:4 The specified value "null" cannot be parsed, or is out of range.
GVH7TFSD.js:4 The specified value "undefined" cannot be parsed, or is out of range.
NZJMPPJZ.js:4 No data was passed to the filter function. The data argument should be an array of objects

After these warnings, the console shows reconnect debug tool messages and then the app crashes.

Could you please help me identify if this is related to the labeling info itself, or if it’s being caused by multiple versions of Lit or some breaking change between 4.30 → 4.33?

Thanks in advance.

0 Kudos
Noah-Sager
Esri Regular Contributor

Hi @CharanpreetKaur, it's difficult to debug from those errors/warnings. I haven't worked with Lit much, and can only focus on our core product.

I noticed that in layers where the labeling info is empty under Drawing Info, there is no issue.


This is curious. You mean in the service definition from REST right, not in the code?

I would test each version individually. Try 4.31, and then 4.32. See if it works in an earlier version. Without a simplified reproducible test-app that demonstrates this issue, it's tricky for me to help more.

0 Kudos
CharanpreetKaur
Emerging Contributor

Hi @Noah-Sager 
My application works fine when I set labelingInfo: []. However, as soon as I add any configuration inside labelingInfo to enable labels, the app crashes with the error “Aw, Snap! Out of Memory.”
I followed the official Esri labeling article and implemented the steps exactly as described, but even that code results in the same crash.
This issue only started appearing after I upgraded from v4.30 to v4.33, where the same configuration worked without any problems.

0 Kudos
Noah-Sager
Esri Regular Contributor

Hi @CharanpreetKaur, I understand. It sounds like you did not make any code changes, and the app still works without labels when you upgraded from 4.30 to 4.33. But if you use labels, it crashes at 4.33.

Updating to a new version of the ArcGIS Maps SDK for JavaScript can require code changes. We list the breaking changes at every release. Here are the breaking changes for 4.31 and 4.32 and 4.33 that might be affecting your app.

https://developers.arcgis.com/javascript/latest/4.31/#breaking-changes

https://developers.arcgis.com/javascript/latest/4.32/#breaking-changes

https://developers.arcgis.com/javascript/latest/release-notes/#breaking-changes

Even if changes were not made to labelingInfo, internally, perhaps in conjunction with loading multiple versions of Lit, changes may be needed in order to update the app to consume different versions of APIs and/or frameworks.

The difficulty here is there is no way for me to debug without a simplified reproducible test-app. I would recommend trying older versions of the SDK (4.31, then 4.32) and see if they work, or if they break in a useful or revealing way. Also, if you have the ability, I would contact Technical Support and open an issue.

0 Kudos