Get the layer Name: app.activeDocument.layers is not working as use to

OK, this might be related:

Adobe Photoshop Prerelease Build 61: Jun 24, 2021

Updated DOM API

  • New Layers collection, the old layerTree object is now called layers but as a collection using the JavaScript Proxy object. See below for introduction of collections. The old layers behavior is no longer part of the DOM. Most scripts can be updated to replace layerTree with layers . A document and a layer, if the layer kind is group, will have a valid layers collection. A pixel layer will have null for the layers property. A collection has the same semantics as an Array. The additional ExtendScript routines of add and getByName are also available. Use LayerKind.GROUP on a layer to see if any layers are available.
  • GroupLayer has been removed. Use activeLayer.kind === LayerKind.GROUP instead.