Uncaught ReferenceError: Highcharts is not defined

Created on 20 September 2023, 9 months ago
Updated 3 October 2023, 9 months ago

Problem/Motivation

After installing the module using composer, and adding the easychart field to my content type, I am facing: Uncaught ReferenceError: Highcharts is not defined.

Steps to reproduce

1. Install the module using: composer require drupal/easychart:^4.0
2. Install the module: drush -y en easychart
3. Add the easychart field to some content type
4. Open the Node creation page containing the newly added field.
5. Open the browser console

-> Uncaught ReferenceError: Highcharts is not defined

What I have found

It seems like the easycharts module is checking with the wrong folder for the sources.

Is:
/libraries/highcharts/code/highcharts-more.js?v=10.1.0 net::ERR_ABORTED 404

Should be:
/libraries/highcharts/js/highcharts-more.js

🐛 Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

🇩🇪Germany sgurlt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sgurlt
  • First commit to issue fork.
  • 🇮🇳India shiv_yadav

    Hi sgurlt, this ("http://code.highcharts.com/zips/Highcharts-10.1.0.zip") zip file not loaded not local server. It's zip related file show 404 error.

  • Status changed to Needs review 9 months ago
  • Status changed to Needs work 9 months ago
  • 🇩🇪Germany sgurlt

    Hi @shiv_yadav, yes correct, it is not loaded. But the dependency should be automatically be handled by composer and not manually by the user.
    So when the user does "composer require drupal/easychart", the highchart library should be downloaded automatically to the correct libraries folder.
    At the moment the highchart library gets downloaded, but the module is looking within the wrong directory for it.

    Is:
    /libraries/highcharts/code/highcharts-more.js?v=10.1.0 net::ERR_ABORTED 404

    Should be:
    /libraries/highcharts/js/highcharts-more.js

Production build 0.69.0 2024