Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot to publish the plugin as forced to use "documentAccess": "dynamic-page", in the manifest #7

Open
yanioaioan opened this issue Nov 14, 2024 · 0 comments

Comments

@yanioaioan
Copy link

Trying to publish the plugin but forces to use "documentAccess": "dynamic-page", in the manifest.
This has in turn requests that async versions of funtions are used which I have trouble with.

For example I cannot do

let collections = figma.variables
    .getLocalVariableCollections()
    .reduce((into, collection) => {
      into[collection.name] = {
        name: collection.name,
        id: collection.id,
        defaultModeId: collection.defaultModeId,
        modes: collection.modes,
      };
      return into;
    }, {});`

anymore as it wants getLocalVariableCollectionsAsynch() to be used instead.

Tried using it as

 const sleep = (n) => new Promise((res) => setTimeout(res, n));
 let collectionsAsync = await figma.variables.getLocalVariableCollectionsAsync();
            let arr = await collectionsAsync
            .reduce( async (into, collection) => {
            await sleep(10);
              into[collection.name] = {
                name: collection.name,
                id: collection.id,
                defaultModeId: collection.defaultModeId,
                modes: collection.modes,
              };
              return (await into);
            }, {});

but couldn't make it work.
Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant