I have a web app with client written on React. I use azure-maps-control@2.3.5 npm package to show the map. I give user zoom in & out buttons and pan option to navigate the map.
I see a lot of warnings "Expected value to be of type number but found null instead", they all lead to obfuscated code. However after debugging I believe that the warning is about a value that comes from Microsoft directly. Here are my findings:
- The error comes from line 5143 (for me)
- The catched error comes from
this.expression.evaluate(this._evaluator)
- It throws in line 3482 (for me) when comparing
this.type to the actual value (I think). In properties of this I can see the name of the parameter that is being checked. The name is always name-f every time the warning appears.
- I have no entry of name-f in my codebase, neither I could find it in the package code. However I found it in API responses. The URL is https://atlas.microsoft.com/styling/styles/road?styleVersion=2023-01-01&mcv=235&api-version=2.0 . So it's internal Azure Maps call to its API.
- The response you can see in the images. There are around 30 entries of
name-f there, one for each layer I suppose. I think I see the problem with it. On internet they suggest to wrap style conditions like:
['get', 'propertyName']
into
[
'case',
['has', 'propertyName'],
['get', 'propertyName'],
defaultValue
]
For example, see question https://learn.microsoft.com/en-us/answers/questions/1442464/error-loading-azure-maps
However you can see on the screenshot, it is not done in the response. The bare ['get', 'name-f'] returns null for text-size I assume and that's why I see sometimes hundreds of these warnings, especially when zooming and panning a lot in a short time.
My questions are:
- Can I do something to fix the invalid
text-size?
- Can I do something to omit the warning?
- Is there a bug reporting system for Azure Maps where I can show it?



