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

ReferenceError: moment is not defined

Đang mở
#643 3 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
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, nodejs
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với lib/schemas/config.js và các thiết lập Dockerfile được đề cập trong báo cáo, sau đó tái hiện lệnh gọi dòng lệnh với các tài nguyên tùy chỉnh và các tùy chọn allowCodeExecution được liệt kê. Xác định lý do moment không khả dụng cho formatter và xác minh một cấu hình cho phép lệnh hoàn tất mà không gặp ReferenceError.

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

Mô tả

pending reply

Hello,

I try to use node-export-server from docker with a formatter using moment.js :

datethe = moment().year(datetheYW[0]).isoWeek(datetheYW[1]).startOf('isoWeek').format('YYYY-MM-DD') + '  w' + datetheYW[1] + '';

but I got this error : ReferenceError: moment is not defined

/bin/docker run -u 0:0 --rm --tmpfs=/run highcharts_es cat lib/schemas/config.js
contains :
custom: [
'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.45/moment-timezone-with-data.min.js'
]

On the dockerfile :
ENV HIGHCHARTS_MOMENT="YES" (or true or 1)
I am not sure it is still valid because HIGHCHARTS_MOMENT does not appear on the documentation
+
npm install -S moment moment-timezone luxon (...)
I am not sure it is needed given lib/schemas/config.js

Could you help me to understand how to make it work please ?

The command line:
/usr/local/bin/highcharts-export-server --resources '[]' --allowFileResources true --allowCodeExecution true --infile "$from" --outfile "$to" $width $height $scale --logLevel 2 --nologo true 2>&1

Ngôn ngữ chính
JavaScript
Star
368
Fork
265
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.