What if you try looping the channels directly? Like
var channelArray = [];
for (let channel of doc.channels) {
channelArray.push(channel.name);
};
I believe logic itself is fine here. Also, you should not get a Proxy
object IMO (see this topic). Maybe that’s the reason, although I don’t see why it would be.
Could you also try just logging each channel? If it logs, see what’s the difference maybe between alpha and RGB
for (let channel of doc.channels) {
console.log(channel);
};