Nothing happens when running plug-in on Windows


#1

I have a plug-in that logs a message. The command shows up in the plug-ins menu but when I click on it on Windows 10, nothing happens and nothing is logged to the developer console. Please advise:

async function insertImage(selection) {
    // Go to Plugins > Development > Developer Console to see this log output
    console.log("Inserting image");
}


module.exports = {
    commands: {
        insertImage: insertImage
    }
};

#2

Are you using typographer quotes in your string? Try using “” instead of “”.
Strange that your console doesn’t display an error.


#3

I am using regular double-quotes in both the JSON and the .JS


#4

Could you please also share the contents of your manifest.json file? The JS looks ggod, so maybe something there could be at fault… Thank you very much in advance :+1:


#5
{
  "name" : "Image 2",
  "host" : {
    "app" : "XD",
    "minVersion" : "13.0.0"
  },
  "description" : "Image 2",
  "id" : "e5a6e291",
  "icons" : [ {
    "path" : "images/icon.png",
    "width" : 96,
    "height" : 96
  } ],
  "uiEntryPoints" : [ { 
    "label" : "Insert image",
    "type": "menu",
    "commandId": "InsertImage"
  } 
],
  "version" : "1.0.0"
}

#6

The problem is that your commandId in the manifest.json begins with a capital letter InsertImage, while your exported function doesn’t (insertImage) – if you fix that, everything should be working as expected :wink:

Hope this helps.

Edit: By the way, your code gets a lot more readable here in the forums if you wrap it in three backticks (`) at the beginning and the end (markdown syntax) :wink:


#7

That isn’t it - I retyped it in the comment to anonymize the scenario.


#8

Sorry, Safari displays curly quotes if not marked as code.


#9

Ok. The problem is that your code looks good so far (I don’t see anything that’s wrong).

I can understand that. However, the code (with the typo being fixed) seems fine (and should work as expected). Therefore, I fear that at this point, we won’t be able to help you much further (since based on the info provided, the code should work just fine). There are a few things that might be able to shed a light here, but other than that, that’s basically it…

  1. Does the console show any errors (and if so: what) when reloading the plugins with Ctrl+Shift+R (on Windows) or Cmd+Shift+R (on macOS)
  2. What parts are different between the code you’ve shared here and your own parts (I’m not asking what your code does, but simply which parts are “changed”)
  3. Could you please try to replicate the issue with the code you’ve provided here (without the typo, of course)? Does this code, by itself, work for you?

#10

Something else is going wrong - I’ve cloned the sample git repro, added the quick-start sample to the develop folder, reloaded plugins, and selected “Create Rectangle” and nothing happens, nothing shows up it the Developer Console. I can help debug this with you if necessary.
Michael Scherotter (mischero@microsoft.com)


#11

I’m testing the same ‘quick-start’ sample from the github repo. On Mac it works.

08

quick-start.zip (2.7 KB)


#12

@stevekwak Is asking around, but we haven’t been able to reproduce the problem yet.


#13

The issue disappeared today and now the plugins work. Very strange - I shared the XD log with the support team.
Michael