I have a JS API 4.25 app where the Editor widget is used to add features to a map, and there is a function to print the map of the current extent. I ran into an issue where the map and the features on the map renders fine but sometimes legends for some of the layers do not show. For example, sometimes the map contains features from the Point, Polygon and Line layers but only Point and Polygon features have legends. None of the Line features show in Legends. I would pan on the map and print again, and usually all of the layers would show next time.
Could this be some kind of caching issue where the MapView is not passing all the layers to PrintParameters? Is there a way to force all of these objects to refresh before printing?