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

Escaped quotes, e.g in formatters, break export

Đang mở
#649 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
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
backend

Hướng nghiên cứu

Tái hiện việc export bằng hai ví dụ JSON, sau đó kiểm tra đường dẫn đánh giá cấu hình trong export.js quanh setAsConfig ở dòng 157 và lệnh gọi triggerExport được hiển thị trong stack trace. Bản sửa hoàn tất khi mã labelFormatter có chứa dấu ngoặc kép được escape được export thành công mà không gặp lỗi cú pháp đã được báo cáo.

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

Mô tả

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)
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.