Articles in this section
Category / Section

How to resolve script error on dashboard reload?

Published:

Resolving Script Error on Dashboard Reload

When working with embedded JavaScript (embed-js) in a dashboard application, you may encounter a script error when reloading the dashboard. This error typically occurs when the load dashboard function is called again after the page has already loaded. Please refer to the below image for reference.

Script_Error.png

Cause of the Error

The error is suspected to occur when the previous dashboard instance is maintained while reloading the dashboard with different values in your embedding application. This can lead to console errors.

Solution

To resolve this issue, it is recommended to destroy the previous dashboard instance before the reload action in your embedding application. This can be achieved using the following code snippet:

var biInstance = BoldBI.getInstance('BoldBiContainer'); // Here the 'BoldBiContainer' denotes embedContainerId that used in BoldBI.create() 
biInstance.destroy();

In the above code, BoldBiContainer denotes the embedContainerId that is used in BoldBI.create(). The destroy() function is used to destroy the previous dashboard instance.

By implementing this solution, you should be able to reload your dashboard without encountering the script error.

Please note: Always ensure to replace 'BoldBiContainer' with your actual embedContainerId in your application.

References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SR
Written by Sethu Raman Athimoolam
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied