I am using the Javascript SDK (4.33.14) and map components (4.33.23) in a React (19.1.0) and Vite (7.0.0) application. I am displaying a point GeoJSON Layer with ~1000 features with no issues. However, when I set labelingInfo, it errors out with the error "Uncaught RangeError: Invalid array length" 235 times. I have double checked the syntax I'm using. I have tried adding the simplest of labels, using different attributes for the label, and installing newer versions of the Javascript SDK and map components (to no avail).
To test labels out in general, I tried adding a label to a separate polygon Feature Layer, but that causes the infinite error "Uncaught TypeError: Cannot destructure property 'vertexStart' of 'e14[s11]' as it is undefined." I'm not sure if that is related or not. I have attached pictures of the console messages.
Here are the relevant parts of the code I'm using:
const viewRef = useRef();
const aLayer = useRef();
const blob = new Blob([JSON.stringify(geojsonData)], {
type: "application/json",
});
const url = URL.createObjectURL(blob);
const labelClass = {
symbol: {
type: "text",
color: "black",
font: {
family: "Noto Sans",
size: 14,
},
},
labelExpressionInfo: {
expression: "$feature.c",
},
};
aLayer.current = new GeoJSONLayer({
title: "Locations",
url: url,
popupEnabled: true,
popupTemplate: popupTemplate,
renderer: uniqueRenderer,
labelingInfo: [labelClass],
});
viewRef.current.map.add(aLayer.current);
Thank you for any help!