How to prevent conflicts of librairies between apps?

Hi,

After installing my app, some users had bugs with other third-party apps.

My Jira app use the library atlassian-jwt.
This library is itself dependant of the lodash library.
Lodash defines the global variable _.
So my app overrides the already existing global variable _.
This causes bugs with other apps that use this variable.
I was able to fix this problem by using the lodash function noConflict() to correct this problem.

Now I think a similar problem might happen with other libraries I use.

Is there any way we can provide isolated scope for web resources to work independently ?

Thanks.

The best solution for this is to use iframes. That way you can isolate your server front-end code.

1 Like