Select to view content in your preferred language

Basemap styles service broken labels and / or icons after 4.28

342
2
12-17-2024 10:50 AM
AlertMediaDev
Emerging Contributor

Using the javascript API in a react / nextjs app, we have intermittent issues with the "navigation" basemap labels and icons.

These issues started occurring for us after switching to the basemap styles service ( "streets" -> "arcgis/navigation")

The sequence is the map loads, we initially see the arcgis/navigation basemap with the labels blurred.   Then, the font file is downloaded, and the labels (sometimes - see interceptor workaround below) draw correctly. 

AlertMediaDev_1-1734460752181.png

AlertMediaDev_0-1734460547746.png

 

These issues are intermittent - sometimes they do not happen, sometimes they happen on every load.  Sometimes they occur on certain pages of the app, but not others (despite the esri logic being identical)

Every tested version after 4.28.10 including next has these issues.  They occur in both chrome and firefox. 

Adding an http interceptor to prevent the fonts from being cached seems to fix the label issues most of the time, but not all.

AlertMediaDev_2-1734460980707.png

This causes the fonts to need to be downloaded every time.   To me this indicates something is broken with timing. 

This unfortunately does not fix the black box city location icons.  We have not found a way to recover from this issue, or even determine via code the issue occurs. 

There is nothing notable about how the map view is constructed (code below is wrapped in useEffect)

AlertMediaDev_3-1734461041713.png

 

This would have been a support ticket, except it is not reproducible with vanilla JS.

This is a similar post:

https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/black-boxes-for-labels/td-p/15356...

 

Can anyone give any tips for getting around this issue? 

2 Replies
AlertMediaDev
Emerging Contributor

I finally made some progress here... I was  not able to reproduce in a fresh app, only our very large, multi-team app 

Steps:

pin the arcgis/core version to =4.28.10. 

deleted package.lock file    (Don't do this unless you want to enter dependency **bleep** and test every feature of your app)

run npm install.   

With a fresh set of dependencies and dependencies, for that specific version, the issue seems to resolve.

0 Kudos
BjornKuiper1
Emerging Contributor

We are experiencing this issue as well. We can't consistently reproduce it as it seems to be a timing issue within the Esri library?

details:

"@arcgis/core": "^4.31.6",
"@esri/calcite-components": "^2.10.1",
"@esri/calcite-components-react": "^2.13.2",
"@esri/calcite-ui-icons": "^3.29.0",

deleting the package lock file isn't a reasonable solution for us.

We tried by setting the language at the very start of the application through

<script>
// Set the locale before the SDK loads
esriConfig = {
locale: "en-US"
};
</script>

It would be nice if Esri could respond or if other users that are experiencing this issue could let us and Esri know. thanks!

0 Kudos