I’ve resolved this exact widget initialization failure multiple times during R2020x upgrades. The solution requires addressing all three key areas:
Widget Initialization Fix:
The R2020x analytics widget requires explicit initialization with the new API. Update your dashboard HTML to include proper widget registration:
var widget = new AnalyticsWidget({
containerId: 'cost-analytics-container',
config: { chartType: 'trend', dataSource: 'cost-mgmt' }
});
widget.initialize();
The key change from R2019x is that chartConfig is now nested under a config object. Your old code was passing chartConfig directly to the constructor which is no longer supported.
JavaScript Error Debugging:
The “Cannot read property ‘chartConfig’ of undefined” error occurs because the widget configuration isn’t loading before initialization. Add defensive checks:
if (typeof widgetConfig !== 'undefined' && widgetConfig.chartConfig) {
widget.setChartConfig(widgetConfig.chartConfig);
} else {
console.error('Widget config not loaded');
}
Enable debug mode in your dashboard to see detailed initialization logs: Add ?debug=true to the dashboard URL and check console for configuration loading sequence.
Dashboard Version Compatibility:
R2020x introduced breaking changes in the analytics widget framework. You need to migrate your widget configuration to the new schema:
- Copy analyticsWidgetConfig.json to analyticsWidgetConfig_v2020.json
- Update the JSON structure for R2020x compatibility:
- Move chartConfig properties under a “config” parent object
- Change “dataSource” to “dataSourceConfig” with explicit connection parameters
- Update “renderOptions” to “displayOptions” with new property names
- Update dashboard reference to use the new config file
- Test in isolated dashboard instance before deploying to production
Pseudocode for config migration:
// Pseudocode - Widget config migration steps:
1. Load existing R2019x widget configuration JSON
2. Create new R2020x config structure with nested objects
3. Map old property names to new schema:
- chartConfig -> config.chart
- dataSource -> config.dataSourceConfig.endpoint
- renderOptions -> displayOptions
4. Validate new config against R2020x widget schema
5. Deploy updated config with version suffix
6. Update dashboard to reference new config file
// See: R2020x Analytics Widget Migration Guide Section 3.4
Critical compatibility note: R2020x widgets require jQuery 3.5+ and Chart.js 3.x. Verify your dashboard includes these library versions. Incompatible library versions cause silent initialization failures.
After implementing these fixes, clear browser cache completely and test with browser dev tools network tab open to verify the configuration file loads successfully. The widget should initialize within 2-3 seconds. If you still see the spinner, check the server logs for widget resource loading errors - sometimes file permissions or path issues prevent config files from being served properly after upgrade.
This draft is based on general ENOVIA knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.