Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Escaped quotes, e.g in formatters, break export

Open
#649 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
backend

Research direction

Reproduce the export with the two JSON examples, then inspect the configuration evaluation path in export.js around setAsConfig at line 157 and the triggerExport call shown in the stack trace. The fix is complete when labelFormatter code containing escaped double quotes exports successfully without the reported syntax error.

Written by the indexing model from the issue text.

Description

Export server version: v5.0.0
Highcharts version: 10.2.1

The only difference between these examples is in used quotes in labelFormatter. Only the first one works with export server.

{
  "infile": {
    "exporting": {
      "enabled": true
    },
    "xAxis": {
      "type": "datetime"
    },
    "legend": {
      "labelFormatter": "function () { if (typeof this.chart.series[0] !== 'undefined') { return this.chart.series[0].name; } return 'Somethign else';}"
    },
    "series": [
      {
        "name": "Temperature",
        "data": [
          {
            "x": 1743214500000,
            "y": 1
          }
        ]
      }
    ]
  }
}
{
  "infile": {
    "exporting": {
      "enabled": true
    },
    "xAxis": {
      "type": "datetime"
    },
    "legend": {
      "labelFormatter": "function () { if (typeof this.chart.series[0] !== \"undefined\") { return this.chart.series[0].name; } return 'Somethign else';}"
    },
    "series": [
      {
        "name": "Temperature",
        "data": [
          {
            "x": 1743214500000,
            "y": 1
          }
        ]
      }
    ]
  }
}

Export server logs and received response from export server for the second example:

{
  "statusCode": 400,
  "message": "[pool] In pool.postWork: For request with ID 935e61e6ae0f4356a2a2264867c6f423 - Error encountered during export: 8.110875ms."
}
2025-04-05 13:29:27 Sat Apr 05 2025 11:29:27 GMT+0000 [error] - [pool] In pool.postWork: For request with ID 935e61e6ae0f4356a2a2264867c6f423 - Error encountered during export: 8.110875ms. 
2025-04-05 13:29:27  SyntaxError: Invalid or unexpected token
2025-04-05 13:29:27 new Function (<anonymous>)
2025-04-05 13:29:27     at triggerExport (evaluate at setAsConfig (file:///home/pptruser/node_modules/highcharts-export-server/lib/export.js:157:15), <anonymous>:63:6)
2025-04-05 13:29:27     at #evaluate (file:///home/pptruser/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:383:19)
2025-04-05 13:29:27     at async ExecutionContext.evaluate (file:///home/pptruser/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:270:16)
2025-04-05 13:29:27     at async IsolatedWorld.evaluate (file:///home/pptruser/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/IsolatedWorld.js:96:16)
2025-04-05 13:29:27     at async CdpFrame.evaluate (file:///home/pptruser/node_modules/puppeteer-core/lib/esm/puppeteer/api/Frame.js:335:20)
2025-04-05 13:29:27     at async CdpPage.evaluate (file:///home/pptruser/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:799:20)
2025-04-05 13:29:27     at async default (file:///home/pptruser/node_modules/highcharts-export-server/lib/export.js:208:9)
2025-04-05 13:29:27     at async postWork (file:///home/pptruser/node_modules/highcharts-export-server/lib/pool.js:328:20)
2025-04-05 13:29:27     at async doExport (file:///home/pptruser/node_modules/highcharts-export-server/lib/chart.js:438:20)
2025-04-05 13:29:27     at async exportHandler (file:///home/pptruser/node_modules/highcharts-export-server/lib/server/routes/export.js:225:5)
Dominant language
JavaScript
Stars
368
Forks
265
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from highcharts/node-export-server

All issues in highcharts/node-export-server

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.