Skip to content

How we can access third party helper lib inside FigmaPluginAPI #6

@adarsh-technocrat

Description

@adarsh-technocrat

I want to use third party lib inside figmaAPI if i try to access it throws me below error

figmaAPI.ts:60 Uncaught (in promise) Error: _figma_plugin_helpers__WEBPACK_IMPORTED_MODULE_6__ is not defined
    at cb (webpack-internal:///(localhost:3000/app-pages-browser)/./lib/figmaAPI.ts:52:32)
cb	@	figmaAPI.ts:60

My Code Sample

   import { nodeToObject } from "@figma-plugin/helpers";


   <Button
        onClick={() => {
          figmaAPI.run(async (figma) => {
            const node = figma.currentPage.selection[0];
            const json = nodeToObject(node);
            console.log(json);
          });
        }}
      >
        Action
      </Button>

Is there is any way i can use this helper functions inside plugin

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions