Skip to main content

Hi,

Got this error while running my plugin on a design.



Error: in postMessage: Cannot unwrap symbol Figma



here is the piece of code where the error occurs


figma.ui.onmessage = async (msg) => {
/**
* The function `readDesign` reads the design data from the current page in Figma and sends it to the
* UI.
*/
const readDesign = async (
selections: {id: string; name: string; isSelected: string}[],
) => {
.....(code)
const getPages = figma.currentPage.findAll((node) =>
selectedPagesId.includes(node.id),
);
const data: any = {};
for (const i of getPages) {
if (i.visible) {
data[i.name] = await extractData(i);
}
console.log("data: ", data);
}
......(code)
figma.ui.postMessage({
type: "readDesign",
data: data,
client: (user.name + user.id).toString(),
system: "M3",
});
}

I have referred this link, from where I got to know that this error occurs when the node property is a mix of multiple values.


Any suggestions on how to process this type of data?


Thanks

Be the first to reply!

Reply