GoogleWebComponents / google-chart

Google Charts API web components
https://www.webcomponents.org/element/@google-web-components/google-chart/elements/google-chart
Apache License 2.0
358 stars 130 forks source link

Charts API loader added twice #233

Closed rslawik closed 5 years ago

rslawik commented 5 years ago

google-charts-loader.js adds the loader.js script for Charts API eagerly if it does not find google.charts.load symbol. However, when the <google-chart> module and other JS code not using <google-chart> but Google Chart directly are added to the document around the same time, there is a race condition which one adds the loader first. This may result in the following error: Google Charts loader.js can only be loaded once.