Plugin development fail

Hello,

I was an Evernote user and just migrated from Evernote to Joplin. It's cool ! :slight_smile:

I had +2000 notes and a lot of links between internal notes which are not automatically migrated. I wanted to develop a plugin to do it (for me and to allow the community to have it).

The thing is, even if it's quite simple to start developing, I'm blocked...

I'm using Windows 10.

I've got this message when trying to start my plugin :
Plugin "com.joplin.plugin.evernoteinternallinksreplacer" was disabled because it requires Joplin version 2.13 and current version is 2.12.18

I changed this in the manifest "app_min_version": "2.12", but I still have the same problem...

Thoughts ?

Thank you !

That probably has to do with changes to the plugin API that were merged into v2.13. Decreasing the minimum app version in manifest.json should work though... (it seems to work for me on Linux).

Here are some things to check:

  1. You've re-built the plugin after changing the version (e.g. with npm run dist).
  2. Joplin has been re-started (you might need to right-click, then click "Quit" on its icon in the Windows system tray).

Hello, thank you personalizedrefriger, I tried again and got a step further !

It seems that I changed the minimum version but it was not in the publish folder. It is now and if I delete the content of the folder and rebuild, it's generated again, so it seems that the build process is ok.

I don't have the error in the console when starting in development mode.

The thing is, now, I don't have any message written in the console whereas I have this in the onStart function :
console.info('Hello world. Test plugin started!');

Here are the logs. I would really love to unblock the situation. Thanks you !

main-html.js:57 09:01:16: defaultPluginsUtils: Could not find default plugins' directory: C:\Users\cyril.sacenda\AppData\Local\Programs\Joplin\resources\build\defaultPlugins - skipping installation.
main-html.js:57 09:01:16: PluginService: Loading plugin from C:/Users/cyril.sacenda/.config/joplindev-desktop/cache/com.joplin.plugin.evernoteinternallinksreplacer
main-html.js:57 09:01:16: SpellCheckerServiceDriverNative: Set effective languages to "fr"
main-html.js:57 09:01:16: joplin.plugins: Starting plugin: com.joplin.plugin.evernoteinternallinksreplacer
main-html.js:57 09:01:16: joplin.plugins: Finished running onStart handler: com.joplin.plugin.evernoteinternallinksreplacer (Took 30ms)
main-html.js:57 Got ipc-message: noteRenderComplete undefined
main-html.js:57 09:01:17: DecryptionWorker: cannot start because no master key is currently loaded.
main-html.js:57 09:01:20: RevisionService: maintenance: Starting...
main-html.js:57 09:01:20: RevisionService: maintenance: Service is enabled
main-html.js:57 09:01:20: RevisionService: collectRevisions: Created revisions for 0 notes
main-html.js:57 09:01:20: RevisionService: maintenance: Done in 104ms
DevTools failed to load source map: Could not load content for file:///C:/Users/cyril.sacenda/AppData/Local/Programs/Joplin/resources/app.asar/index.js.map: Unexpected end of JSON input

Joplin should create a separate console window for the plugin's background script — the log output should go there.

Thank you again. I found how to get the console dedicated to the plugin. I was installing the plugin "From file" instead of pointing to the folder containing the files.

Another problem coming just after that, I can't rebuild the project, in fact there are a lot of error in the /api files. It doesn't find the resources. I don't really know what to do...

Logs:
api/Global.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/Joplin.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/Joplin.d.ts:13:40 - error TS2307: Cannot find module '../BasePlatformImplementation' or its corresponding type declarations.

13 import BasePlatformImplementation from '../BasePlatformImplementation';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

api/JoplinContentScripts.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinData.d.ts:1:27 - error TS2307: Cannot find module '../../../BaseModel' or its corresponding type declarations.

1 import { ModelType } from '../../../BaseModel';
~~~~~~~~~~~~~~~~~~~~

api/JoplinData.d.ts:2:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

2 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinImaging.d.ts:50:89 - error TS2307: Cannot find module '../../database/types' or its corresponding type declarations.

50 toJpgResource(handle: Handle, resourceProps: any, quality?: number): Promise<import("../../database/types").ResourceEntity>;
~~~~~~~~~~~~~~~~~~~~~~

api/JoplinImaging.d.ts:55:71 - error TS2307: Cannot find module '../../database/types' or its corresponding type declarations.

55 toPngResource(handle: Handle, resourceProps: any): Promise<import("../../database/types").ResourceEntity>;
~~~~~~~~~~~~~~~~~~~~~~

api/JoplinPlugins.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinSettings.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinViews.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinViewsDialogs.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinViewsMenuItems.d.ts:2:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

2 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinViewsMenus.d.ts:2:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

2 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinViewsNoteList.d.ts:2:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

2 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinViewsNoteList.d.ts:22:40 - error TS2314: Generic type 'Store' requires 1 type argument(s).

22 constructor(plugin: Plugin, store: Store);
~~~~~

api/JoplinViewsPanels.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinViewsToolbarButtons.d.ts:2:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

2 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinWindow.d.ts:1:20 - error TS2307: Cannot find module '../Plugin' or its corresponding type declarations.

1 import Plugin from '../Plugin';
~~~~~~~~~~~

api/JoplinWorkspace.d.ts:1:30 - error TS2307: Cannot find module '../../database/types' or its corresponding type declarations.

1 import { FolderEntity } from '../../database/types';
~~~~~~~~~~~~~~~~~~~~~~

Found 20 errors in 16 files.

Errors Files
1 api/Global.d.ts:1
2 api/Joplin.d.ts:1
1 api/JoplinContentScripts.d.ts:1
2 api/JoplinData.d.ts:1
2 api/JoplinImaging.d.ts:50
1 api/JoplinPlugins.d.ts:1
1 api/JoplinSettings.d.ts:1
1 api/JoplinViews.d.ts:1
1 api/JoplinViewsDialogs.d.ts:1
1 api/JoplinViewsMenuItems.d.ts:2
1 api/JoplinViewsMenus.d.ts:2
2 api/JoplinViewsNoteList.d.ts:2
1 api/JoplinViewsPanels.d.ts:1
1 api/JoplinViewsToolbarButtons.d.ts:2
1 api/JoplinWindow.d.ts:1
1 api/JoplinWorkspace.d.ts:1

That's strange... In one of my building plugins, these imports of seemingly non-existent files are present. Maybe it has to do with how the plugin is being built?

Here are some things to try:

  1. Make sure you're using npm run dist to build the plugin (or yarn dist, or similar) and not npm run tsc
  2. Try removing dist and publish and building again