Panel Conflict with other panel

I been making multiple plugin, xxx-escaxxxx-panel, xxx-escaxxxx-panel,xxx-escaxxxx-panel, … but what happened is they have the same .tsx elements and start messing around. In each of the panel, I copy and pasted the textbox.tsx, and textbox.css. Ofc they have the same tsx but the style(textbox.css) is different in each panel. The problem was that when I finished with my development of the plugin and I distributed all of them to my local Grafana, the three panels started messing with each other. The first panel will use the textbox.tsx and textbox.css from the second panel. It sounds crazy but this is true. How I know is I recognize the style is from the second panel. It will fix itself with a refresh button then it will find the right tsx and CSS file. But this is annoying and my panel is for professional use. I don’t want this to happen.

Hi @morpinma it is not possible for panels to mix up their TSX files because in reality Grafana never loads the tsx files. It uses the bundled version from webpack that takes care of creating the correct namespaces that won’t collide.

What is more likely happening is that you are using global css classes that are colliding with each other. You should not be using css files that you import in your js files (like import textbox.css) because that will definitely create conflicts with other elements in the page using the same css classes and ids.

Instead of importing the css files you should be using emotion css

I would also like to ask you how are you developing your panel plugins. Are you developing them all independently? I mean, each one bootstraped independently with create-plugin and each one having its own build step?

Hi @academo, I’d used import textbox.css. Now after hearing the explanation from you, I think this is definitely the problem. I never read that I needed to use emotion CSS when developing Grafana plugin. Where can I read more about this? And why is this necessary? To answer your second question, I’d develop them independently but all of them are similar they share like 5 TSX classes between each panel plugin. I create each of them with npx @grafana/create-plugin@latest. Thank you so much for your help