Chart.js fails to load after upgrade to 9.2.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Juantreses
    Junior Member
    • Aug 2025
    • 13

    #1

    Chart.js fails to load after upgrade to 9.2.2

    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.

    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 **/
                    });
           }
    });
    The above (while somewhat unorthodox) worked perfectly fine for me.

    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)
    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
    Code:
    client/custom/lib/*.js
    . They’re standard minified UMD libs.

    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
      }
    }
    jsLibs.json contains the follwong config:
    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"
        }
    }
    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?​
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9440

    #2
    This? https://github.com/espocrm/espocrm/issues/3480
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Juantreses
      Junior Member
      • Aug 2025
      • 13

      #3
      Thanks Yuri, that's it

      Comment

      Working...