Extra scripts in header

Hello,

I’m currently experiencing a bug with my bubble application.
It seems that extra script tags exist on my pages, and I can’t see where they are imported…

I’ve created a new blank page, nothing inside. I when I’m doing the rendering, I can see the following script import:

I really can’t see where this Highcharts and Chartjs are defined.
There is nothing in the system settings, no custom scripts/meta tags.

Do someone have experienced the same issue? It’s breaking some of my pages because of chartjs being imported 2 times with different versions.
Could it be because of a plugin? However, plugins inject scripts when they are added to a page?

Thanks,
Vgodin

Yes, it could be.

Not necessarily. Plugins can add scripts to every page.

Have you tried previewing your app without plug-ins loaded? Hover over the Preview button and choose Safe - no community plugins.

1 Like

Thank you @sudsy, I missed this preview feature.

Indeed, the highcharts.js is not injected so that’s definitely a plugin.

If I have a conflict with 2 plugins, should I contact the developer? maybe they have a way to limit the script/javascript injection to several pages.

Vgodin

I think that would be your best bet.

1 Like

You should ask plugin author to not add shared headers if this is not needed and can be added to element instead. When plugin use shared header, this will inject header everywhere in the app. But when you use header in element, this will only add headers when element is added to a page

2 Likes

Thanks @Jici @sudsy, it really helps !

1 Like

I’ve found a dirty way to resolve the conflicts with my javascript imports while waiting for the developer’s feedback.

Between the shared header, global headers, custom HTML, you have plenty of ways to import libraries on your page.
And in your HTML page, the last library import will take precedence over the old one: if your import highcharts.js@1.0, then highcharts.js@2.0, the highcharts.js available in your javascript is version 2.0.

What I’ve done to solve my conflict problem is adding an HTML element on the page to re-import the libraries I need.
The HTML element is processed after the custom headers, so I can control my library versions.

It’s a quick fix…

This topic was automatically closed after 14 days. New replies are no longer allowed.