On a Contacts page I render some data using Chart.js. This worked fine until the automatic upgrade to EspoCRM 9.2.2.
Was there any change in how the client loader or module resolution behaves? I couldn’t find anything related to this in the changelog or forum.
The above (while somewhat unorthodox) worked perfectly fine for me.
After the upgrade, I’m seeing these errors:
Notice the chart.js.js in the get call for the transpiled code. Also there is no transpiled directory at all?
The libraries are located under
. They’re standard minified UMD libs.
My client.json has the following config:
jsLibs.json contains the follwong config:
Any idea if something changed in how Espo resolves lib! paths or how it handles custom libraries in /client/custom/lib/ since 9.2.2?
Was there any change in how the client loader or module resolution behaves? I couldn’t find anything related to this in the changelog or forum.
Code:
define([
'views/record/panels/bottom',
'lib!chart'
], (BottomPanelView, Chart) => {
return class extends BottomPanelView {
/** code **/
initializeChart() {
require(['lib!client/custom/lib/chartjs-adapter-date-fns.js'], (dateFnsAdapter) => {
this.gewichtChart = new Chart(canvas.getContext('2d'), {
/** code **/
});
}
});
After the upgrade, I’m seeing these errors:
Code:
Uncaught Error: This method is not implemented: Check that a complete date adapter is provided.
at Ln (chart.js?r=1759626017:19:103318)
at En.formats (chart.js?r=1759626017:19:103536)
at No.init (chart.js?r=1759626017:19:153376)
at chart.js?r=1759626017:19:92709
at u (chart.js?r=1759626017:13:1237)
at An.buildOrUpdateScales (chart.js?r=1759626017:19:92434)
at An._updateScales (chart.js?r=1759626017:19:95168)
at An.update (chart.js?r=1759626017:19:94331)
at new An (chart.js?r=1759626017:19:90875)
at weight-progression.js?r=1759626017:302:37
Code:
GET https://crm.slimfit-center.be/client/lib/transpiled/src/chart.js.js?r=1759626017 net::ERR_ABORTED 404 (Not Found)
The libraries are located under
Code:
client/custom/lib/*.js
My client.json has the following config:
Code:
{
"lib": {
"chart": "client/custom/lib/chart.js",
"chartjs-adapter-date-fns": "client/custom/lib/chartjs-adapter-date-fns.js",
"chartjs-plugin-datalabels": "client/custom/lib/chartjs-plugin-datalabels.js"
},
"quickCreateDisabled": {
"Contact": true
}
}
Code:
{
"chart": {
"path": "client/custom/lib/chart.js",
"exportsTo": "window",
"exportsAs": "Chart"
},
"chartjs-adapter-date-fns": {
"path": "client/custom/lib/chartjs-adapter-date-fns.js",
"exportsTo": "window",
"exportsAs": "ChartDateFns"
},
"chartjs-plugin-datalabels": {
"path": "client/custom/lib/chartjs-plugin-datalabels.js",
"exportsTo": "window",
"exportsAs": "ChartDataLabels"
}
}

Comment