Plugin: "Plugin archive was not created because the "dist" directory is empty"

A few weeks ago I started on a new plugin. (It connects to my personal databases, so no reason to put it on github.)

I installed or updated all tools, followed the tutorial (created a plugin with yo etc), but when I run npm run dist, I always get the Plugin archive was not created because the "dist" directory is empty error.

> npm run dist

> private-zble-sk-cortex-sync@1.0.0 dist
> webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive

Plugin archive was not created because the "dist" directory is empty

The "dist" directory is, in fact, not empty: it contains both manifest.json and index.js files. When I manually pack them up and rename the archive to .jpl, I can import it into Joplin and it works.

But my previous attempts at plugins (which I no longer use) never had this problem; and I've been unable to fix it.

Did this happen to anyone else? Any idea on how to get rid of it?

Hmm, not sure, maybe this is actually broken because I see it depends on the glob package, and they recently changed their API. Could you create an issue on GitHub to track this?

I cannot replicate this with the latest generator. Could you try to update to see if it helps? npm install -g yo generator-joplin

Also are there any spaces in your development directory path? And which OS do you use?

I'll try when I'm at the PC.
So I should create a new project, and if it starts working, I should copy my code over to this one, right?

(I have tried updating it when I started the project, but then again, it was a few weeks ago. I'm on windows 10. No spaces in path.)

I'll update when I've had the time to try.

I did the update, created a new project - same error.

Are you doing it in windows? Directly, or wsl? (I tried both)

Someone seems to have solved it here: Problems to build plugin with new node js version

I'll apply the same fix on the repo

1 Like