drawio-desktop icon indicating copy to clipboard operation
drawio-desktop copied to clipboard

Unable to load plugin if opening a new project

Open dzylikecode opened this issue 2 years ago • 15 comments

Preflight Checklist

  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

Describe the bug A clear and concise description of what the bug is.

Plugins work fine after the first time restarting to take effect. But if opening another project or reopening the current project, plugins don't work. The board of plugins shows all is loaded, but the developer's tool doesn't list the folder plugins.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Extras'
  2. Click on 'plugin' and add any plugins (like text.js)
  3. Restart to take effect -> board list text.js | Adds Extras > Extract Text | develop tools list all plugins loaded (plugins/text.js)
  4. Close the project and open another project
  5. Click Extras > Plugin -> list text.js
  6. Click Extras -> Extract Text Not found
  7. Open develop tools -> plugins/text.js not loaded

Expected behavior A clear and concise description of what you expected to happen.

The plugin should work for all the projects after it's loaded. It's contradictory that the board shows the plugin loaded but it doesn't work. And it saves much time if it takes effect for all instead of just the current project.

Screenshots If applicable, add screenshots to help explain your problem.

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 22.0.2

Desktop (please complete the following information):

  • OS: Windows

Additional context Add any other context about the problem here.

dzylikecode avatar Oct 20 '23 03:10 dzylikecode

And you've enabled plugins in the command parameters to run desktop?

davidjgraph avatar Oct 20 '23 11:10 davidjgraph

yes, here was the command I used.

'C:\Program Files\draw.io\draw.io.exe' --enable-plugins "d:\FDU\FDU-Course\docs\HW\02\HW-02-04.drawio.svg"

dzylikecode avatar Oct 21 '23 04:10 dzylikecode

Unfortunately, we couldn't reproduce. Is there any errors in the developer tools?

m-mohamedin avatar Dec 27 '23 19:12 m-mohamedin

I think plugin path may be not right. when you first added the plugin ,path is 'plugin/sql.js'; but when you restart app the plugin path is './plugin/sql.js'. now plugin cannot work, dev tool can not find plugin sql.js. draw io_UW9xNO7K7W

maochunguang avatar Dec 30 '23 00:12 maochunguang

I think plugin path may be not right. when you first added the plugin ,path is 'plugin/sql.js'; but when you restart app the plugin path is './plugin/sql.js'. now plugin cannot work, dev tool can not find plugin sql.js. draw io_UW9xNO7K7W

Did you run the app with --enable-plugins parameter?

m-mohamedin avatar Dec 30 '23 02:12 m-mohamedin

I think plugin path may be not right. when you first added the plugin ,path is 'plugin/sql.js'; but when you restart app the plugin path is './plugin/sql.js'. now plugin cannot work, dev tool can not find plugin sql.js. draw io_UW9xNO7K7W

Did you run the app with --enable-plugins parameter?

yes, I start app with command line with --enable-plugins parameter , but plugins can not work. The plugins only work in your first time, when you create new file plugin can not work.

maochunguang avatar Dec 30 '23 07:12 maochunguang

I record a gif. draw io_jmK5GK2HzZ

maochunguang avatar Dec 30 '23 07:12 maochunguang

I think plugin path may be not right. when you first added the plugin ,path is 'plugin/sql.js'; but when you restart app the plugin path is './plugin/sql.js'. now plugin cannot work, dev tool can not find plugin sql.js. draw io_UW9xNO7K7W

Did you run the app with --enable-plugins parameter?

yes, I start app with command line with --enable-plugins parameter , but plugins can not work. The plugins only work in your first time, when you create new file plugin can not work.

This is the problem I'm encountering. So I have to uninstall the plugin, then reload it and restart the software each time.

dzylikecode avatar Dec 31 '23 13:12 dzylikecode

As a workaround, please try editing the shortcut and add --enable-plugins to the Target Screenshot 2023-12-31 at 5 10 50 PM

m-mohamedin avatar Dec 31 '23 23:12 m-mohamedin

As a workaround, please try editing the shortcut and add --enable-plugins to the Target Screenshot 2023-12-31 at 5 10 50 PM

It is the same things as before.

maochunguang avatar Jan 01 '24 06:01 maochunguang

As a workaround, please try editing the shortcut and add --enable-plugins to the Target Screenshot 2023-12-31 at 5 10 50 PM

It is the same things as before.

What's your version, I cannot reproduce?

m-mohamedin avatar Jan 01 '24 23:01 m-mohamedin

I resolved this by delete appdata cache. I think drawio can not load plugin because of app cache in windows.

maochunguang avatar Jan 11 '24 11:01 maochunguang

@dzylikecode as the OP, what is the status of your issue?

davidjgraph avatar Jan 11 '24 11:01 davidjgraph

I have not resolved it yet, and I am still using the approach I mentioned earlier.

dzylikecode avatar Jan 11 '24 16:01 dzylikecode

Same thing.

Draw.io: v24.2.5 OS: Win11

Steps to reproduce:

  1. Add any plugin (e.g. "anon", as it's easy to see difference. it's adds menu item to "Extras").
  2. Get warning that changes will be applied after restart.
  3. Close the app. !Important! Do not run Draw.io by shortcut on desktop or start menu! Instead of that open some .drawio file.
  4. Plugin is works. But not so long.
  5. Close the app. Open some .drawio file again.
  6. Plugin is not works!

filantus avatar Apr 21 '24 04:04 filantus

12.4.0

davidjgraph avatar May 13 '24 15:05 davidjgraph