plugma icon indicating copy to clipboard operation
plugma copied to clipboard

[Bug] when I tried to open the UI page, the service reported a 404 error

Open GrinZero opened this issue 1 year ago • 10 comments

Desc

Today I added a menu field to the manifest and added commands to it:

image

And when I finish my code and run it:

image

I found that every time I try to open the plugin UI, a web server-side 404 error appears directly:

image image

GrinZero avatar Dec 28 '24 15:12 GrinZero

Just one more piece of information, this is a monorepo project

GrinZero avatar Dec 28 '24 16:12 GrinZero

Thank you for reporting this. Would you mind posting a screenshot of the part of the manifest that has the ui and main fields? And then I should be able to take it from there.

Thanks again!

gavinmcfarland avatar Dec 29 '24 20:12 gavinmcfarland

I have identified the key issue. image Currently, there are no issues with using tmp/index.html in the code in single repository mode. But when in the monorepo repository, as a sub repository, plugma may be installed in the outermost node_modules, which can cause the position of the tmp folder to be abnormal and result in the inability to find the tmp/index.html file during actual code execution

This is a pr to fix it: #48

GrinZero avatar Dec 30 '24 03:12 GrinZero

Since Rollup does not accept relative or absolute paths, I chose to fix this issue by copying the folder to the correct path

GrinZero avatar Dec 30 '24 03:12 GrinZero

Thank you I'll review your PR in the next couple of weeks.

gavinmcfarland avatar Jan 03 '25 11:01 gavinmcfarland

I was just reviewing your PR and I wondered if you had an example monorepo of this you could share? It would be useful to be able to test and also to see how you're using Plugma with a monorepo. Many thanks!

gavinmcfarland avatar Jan 09 '25 01:01 gavinmcfarland

I'll prepare a demo later.👌In fact, I started with the initial project of turbo + pnpm

GrinZero avatar Jan 17 '25 06:01 GrinZero

Hello, I'm sorry. I tried using a demo and found that it couldn't be replicated. A strange phenomenon is that not all times Monorepo installs the plugin on the outer layer. I can only replicate it in my company's project, but I don't have time to desensitize the company's project framework and make a demo at the moment.

GrinZero avatar Feb 25 '25 07:02 GrinZero

Ok thanks. We will be release a new version soon, so I'll try creating a test case when we do to see if the issue still exists.

gavinmcfarland avatar Feb 26 '25 17:02 gavinmcfarland

Hi @GrinZero, I just wanted to let you know I'm able to recreate this issue now. When I get time I'll look at the implementation again and see if I can apply it to the next release.

gavinmcfarland avatar May 10 '25 00:05 gavinmcfarland

I think this should be fixed in v2. If anyone notices the same issue in v2, feel free to comment.

gavinmcfarland avatar Oct 26 '25 15:10 gavinmcfarland