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

Plugin not loaded #9

Open
aztack opened this issue Oct 15, 2024 · 1 comment
Open

Plugin not loaded #9

aztack opened this issue Oct 15, 2024 · 1 comment
Labels
question Further information is requested

Comments

@aztack
Copy link

aztack commented Oct 15, 2024

I git cloned this repo and replaced id with my plugin id and run npm run dev,
import plugin manifest.json from dist file. Figma popup a toast saying my plugin has been imported. But there nothing changed/show up in the plugin panel
// Upate:
I resolved the problem by added inspect capability and dev editorType

// https://www.figma.com/plugin-docs/manifest/
export default {
  name: "Mojito Designer",
  id: "1427862707767191704",
  api: "1.0.0",
  main: "plugin.js",
  ui: "index.html",
  capabilities: ["inspect"],
  enableProposedApi: false,
  editorType: ["figma", "figjam", "dev"],
};

and also modify plugin.ts as follow:

import * as Networker from "monorepo-networker";
import { initializeNetwork } from "@common/network/init";
import { NetworkSide } from "@common/network/sides";
import { NetworkMessages } from "@common/network/messages";

async function bootstrap() {
  initializeNetwork(NetworkSide.PLUGIN);

  debugger;
  if (figma.editorType === "figma" || figma.editorType === "dev") { // <----- 
    figma.showUI(__html__, {
      width: 800,
      height: 650,
      title: "My Figma Plugin!",
    });
  }

  console.log("Bootstrapped @", Networker.Side.current.getName());

  NetworkMessages.HELLO_UI.send({ text: "Hey there, UI!" });
}

bootstrap();
@iGoodie
Copy link
Member

iGoodie commented Nov 6, 2024

Oh I see Figma separated the editorType into "figma" for the design mode, "dev" for the dev mode.
I'll update the initial figma.manifest.ts to reflect that! Thanks for pointing that out!

For the "inspect" capability, do you actually use anything that requires that capability in your UI code?

@iGoodie iGoodie added the question Further information is requested label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants