ServiceNow Widget Dependency

ican
Tera Contributor

Use Case:

Im using ChartJs in a widget and im adding it as dependencies:

ChartJs:

https://cdn.jsdelivr.net/npm/chart.js/dist/chart.umd.min.js

Datalabels Plugin:

text/javascript" src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2

 

Im having ChartDataLabels not defined error when i load the widget but when Im using the same above CDN in it working fine and the Line Graph is displaying as expected.

 

Is this some kind of dependency load issues in ServiceNow Widget?

 

Thanks.

1 REPLY 1

Daniel Vieira
Tera Expert

Hi @ican 

 

Did you find out some solution? I have the same problem. The dependency works with CDN but with the code of the library inserted in UI Script doesn't. Did you find something to solve this problem?

 

Thanks!

Daniel Vieira