Plugin is showing twice

Hi,

I created one sidebar plugin following steps from

Then I started the plugin on localhost:3000 using npm run start.

But when I installed the plugin as a private one from my project’s plugin page and set the plugin URL to localhost:3000, it starts showing twice.
Screenshot

Thanks,
Jyotirmoy Biswas

Hello @jyoti

Can you share the code with us? perhaps with a git repo?
Thank you!

Also the URL of the project would help!

Hi,

Git repo: GitHub - cefalo-jyotirmoy/copy-test-product
Project url: https://cms.friflyt.no/

Thanks,
Jyotirmoy Biswas

Hello @jyoti

I see in your project that you have three private plugins with the same endpoint http://localhost:3000/
This makes your local plugin be loaded three times by your project.
If you have only one private plugin with the http://localhost:3000/ endpoint, your plugin should work as expected.

Hope this helps!

Hi,

Thanks for your feedback. We have three different plugins. Those are on developing mode. Not running from same machine. If I run the plugin from different port(other than 3000), will it solve the problem?

If yes, how can I change the default port number on my plugin? Or do you suggest any other solution?

Thanks again,
Jyotirmoy Biswas

I’m aware that they are different plugins on different machines, but as for your current configuration, your project is making 3 calls to the same endpoint, as all private plugins have the same endpoint on the dato dashboard, making whichever plugin that is running on your machine under http://localhost:3000 be loaded 3 times.

Running different plugins on different ports will solve the problem.
You can change the port on your plugin, by modifying it’s package.json file:
under "start"

You can make it into:

"start": "cross-env BROWSER='none' PUBLIC_URL='/' PORT=YOUR_PORT_NUMBER react-scripts start",

This way, by restarting your development server, it will now be served on http://localhost:YOUR_PORT_NUMBER/

Then, change the plugin configurations on dato so that each plugin call has a different endpoint.

Hi,

Changing port solves the problem.

Many thanks
Jyotirmoy Biswas