I created a Figma plugin (the orange rectangle creation as per Figma documentation)
When I send message from HTML to typescript, it is working fine.
I wrote a message handler in HTML. So that when I send a message from typescript to HTML, I can process it. Trust me, it was working fine. But not now.
Example is here…
in typescript,
Figma.ui.postMessage({ type: ‘totalSelected’, totalItemsSelected: selection.length });
To be honest I have a good news. I resolved the problem by going to Figma documentation, from there I got a github repository of Figma sample projects. There I found a PostMessage() example, I used that and it started working.