Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Chart resources are injected after chart initialization

Đang mở
#690 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
66/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, nodejs
Lĩnh vực
backend

Hướng nghiên cứu

The bug is in lib/export.js: addPageResources runs after the config branch that performs the straight inject, so the styledMode CSS check fires before resources load. Read the JSON config handling block and the injectedResources bookkeeping, then move the addPageResources call ahead of the strInj branch as the reporter's patch does. Done when an export with styledMode=true and highcharts >=12.5.0 no longer logs the "Missing highcharts.css file" warning and injectedResources is still cleared between exports.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When using styledMode=true with the export server running highcharts >=12.5.0 all charts are returned with the "Missing highcharts.css file" warning, irrespective of whether it is actually missing.

After looking through some code, it seems that resources that are passed in the export request are loaded after chart initialization, which is when the warning is encountered. I am currently using the following patch to work around this issue.

--- node_modules/highcharts-export-server/lib/export.orig.js	2026-10-14 13:43:39.623022536 -0400
+++ node_modules/highcharts-export-server/lib/export.js	2026-10-14 13:39:49.803019386 -0400
@@ -202,6 +202,11 @@
       // JSON config handling
       log(4, '[export] Treating as config.');
 
+      // Keeps track of all resources added on the page with addXXXTag. etc
+      // It's VITAL that all added resources ends up here so we can clear things
+      // out when doing a new export in the same page!
+      injectedResources = await addPageResources(page, options);
+
       // Need to perform straight inject
       if (exportOptions.strInj) {
         // Injection based configuration export
@@ -225,11 +230,6 @@
       }
     }
 
-    // Keeps track of all resources added on the page with addXXXTag. etc
-    // It's VITAL that all added resources ends up here so we can clear things
-    // out when doing a new export in the same page!
-    injectedResources = await addPageResources(page, options);
-
     // Get the real chart size and set the zoom accordingly
     const size = isSVG
       ? await page.evaluate((scale) => {
Ngôn ngữ chính
JavaScript
Star
368
Fork
266
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của highcharts/node-export-server

Tất cả issue của highcharts/node-export-server

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.