Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Chart resources are injected after chart initialization

Aperta
#690 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, nodejs
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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) => {
Lingua principale
JavaScript
Stelle
368
Fork
266
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di highcharts/node-export-server

Tutte le issue di highcharts/node-export-server

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.