This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Jason Nelson
Posted Jun 23 - Read on Facebook

Has anyone run into the following issue?

I'm running into an issue where I push layers into an array and then when I reference them later I run into an error. Trying to "print" the reference to the layer via the array results in returning this:

[object Object]

Instead of what I would expect, something like this:

[<Layer id:1 name:layerA (0,0) 200x200>]

It only happens in certain scenarios, and I can't share the project where it's happening. I don't know what I did to change what the output would be. Thoughts on how I did this or ways around it? Can I do anything to the "[object Object]" to find out what's inside it?



Sigurd Tapio Mannsåker

[object Object] is the standard string representation of an Object, although I can't remember I've seen it as print() output in Framer. Have you tried using console.log() instead? Then just hit cmd+alt+i and see what your JS console says. You'll be able to expand objects and arrays to inspect their properties, which might give you some further clues.

Brian Williams

also can you just tell us how you are instantiating the array and adding to it?

Read the entire post on Facebook