highcharts / highcharts/node-export-server

ReferenceError: moment is not defined

Open
#643 3 comments 0 reactions 0 assignees View on GitHub
pending reply
Dominant language
JavaScript
Stars
369
Forks
266
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.