[charts_highcharts] Remove weight from library definition to fix JS load order

Created on 17 September 2025, 22 days ago

Problem/Motivation

When using the charts_highcharts library, a JavaScript error occurs:
TypeError: Cannot read properties of undefined (reading 'Contents')
This happens because charts_highcharts.js is loaded before charts.js.
The root cause is that the library definition for charts_highcharts sets a negative weight (weight: -1), which can cause it to load earlier than its dependency (charts/global).

Steps to reproduce

1. Enable the Charts module and Charts Highcharts submodule.
2. Configure Highcharts.
3. Visit How to Use the Charts API page. (charts/example/display)

Proposed resolution

Remove the weight: -1 from charts_highcharts.libraries.yml to ensure the dependency charts/global is always loaded first.

Patch attached

The patch removes the unnecessary weight setting.

Result after applying the patch

1. charts.js is always loaded before charts_highcharts.js.
2. No more undefined JavaScript errors.

πŸ› Bug report
Status

Needs review

Version

5.1

Component

Highcharts integration

Created by

πŸ‡­πŸ‡ΊHungary lohndaniel

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024