How to solve erros when Load Plugin(XD) on UXP?

>>> manifest.json <<<

{
“id”: “useall-tdu-2”,
“name”: “Hello World sample plugin”,
“version”: “0.0.1”,
“description”: “Description of your plugin.”,
“summary”: “Summary of your plugin”,
“languages”: [“en”],
“author”: “Your Name”,
“helpUrl”: “https://mywebsite.com/help”,
“host”: {
“app”: “XD”,
“minVersion”: “38.0”
},
“uiEntryPoints”: [
{
“type”: “menu”,
“label”: “Create Rectangle”,
“commandId”: “createRectangle”
}
]
}

>>> main.js <<<

// [1]
const { Rectangle, Color } = require(“scenegraph”);

// [2]
function rectangleHandlerFunction(selection) {
// [3]
const newElement = new Rectangle();
newElement.width = 100;
newElement.height = 50;
newElement.fill = new Color(“Purple”);

// [4]
selection.insertionParent.addChild(newElement);
// [5]
newElement.moveInParentCoordinates(100, 100);
}

// [6]
module.exports = {
commands: {
createRectangle: rectangleHandlerFunction,
},
};

//---------------------------

These are the two files I have in my plugin folder.
I just noticed that in the “app logs” tab I have an error and some other alerts, but I couldn’t find any possible errors in my files in front of the warnings:

[2022-11-01 18:10:01:141] [general] The message could not be dispatched on the thread dispatcher_->TryRunAsync
[2022-11-03 07:55:54:251] [general] Plugin rejected - useall-tdu-2 due to invalid object
[2022-11-03 09:32:45:986] [general] We are going to deprecate HostInfo API soon, please use HostApi instead.
[2022-11-03 09:32:46:007] [general] We are going to deprecate HostInfo API soon, please use HostApi instead.
[2022-11-03 09:32:46:030] [general] We are going to deprecate HostInfo API soon, please use HostApi instead.
[2022-11-03 09:32:46:044] [general] We are going to deprecate HostInfo API soon, please use HostApi instead.

While I was writing this message the plugin just loaded by itself, the errors disappeared from the console. Apparently problem solved, but no clear cause…
:neutral_face:

So I removed the plugin, and I try to add it again, the error comes again…

I fixed the indentation of the manifest.json after I kept getting this error in the app logs:
[2022-11-03 09:42:30:802] [general] Plugin rejected - useall-tdu-2 due to invalid object

And I added it again, I tried to load it again and I got the same error, I came back here to report and I kept trying to load the file, and out of nowhere and it loaded again. I do not know what happens…
It seems like some delay, or time to read the files, which I would say is strange considering the files are super light.

I believe it is something related to the indentation of the files, even though it is a valid json it is giving this problem when the indentation is not correct.

Well, continue my studies here in the tool…