dperiyas
Posts: 12
Joined: Thu Feb 24, 2022 1:01 pm

Export server not configured error

Hi,
After enabling the highcharts-export-server by running highcharts-export-server --enableServer 1
we got export-server has started
Capture.PNG
Capture.PNG (5.58 KiB) Viewed 3223 times

But after starting the server we run the below curl command
curl -H "Content-Type: application/json" -X POST -d "{ \"infile\": { \"title\": { \"text\": \"Steep Chart\" }, \"xAxis\": { \"categories\": [ \"Jan\", \"Feb\", \"Mar\" ] }, \"series\": [ { \"data\": [ 29.9, 71.5, 106.4 ] } ] }, \"width\": 1200 }" localhost:7801 -o output-file.png

Then in the exported output file it is shown as Export server not configured like below we didnot get proper export file
output-file.png
output-file.png (23.95 KiB) Viewed 3223 times
Even after running node build.js command in export server root multiple times we got the same error in output file

Could please tell why this issue occurred when we try to export file as we are trying to implement highcharts-export-server in angular application
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

Hi there,

I have forwarded your request to our export server developer. Once I get the answer, I'll get back to you as soon as possible.

Thank you for your patience,
Best regards!
Kamil Musiałowski
Highcharts Developer
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

Hi,

We have already discussed similar (or even the same problems) on Stack Overflow, and this forum as well.

Please take a look at the solutions provided in the sources below.

Stack Overflow: https://stackoverflow.com/questions/667 ... ort-server
Forum: viewtopic.php?f=9&t=48325

Let me know if you have managed to fix the issue,
Best regards!
Kamil Musiałowski
Highcharts Developer
dperiyas
Posts: 12
Joined: Thu Feb 24, 2022 1:01 pm

Re: Export server not configured error

Hi,
Even with the solutions provided in the below sources not able to resolve the issue.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

Hi there,

Are you sure that you have typed 'y' in the first question about the license? That a quite an easy mistake to do. Please reinstall the export server, run npm install again, and make sure to enter 'y' in the first question about the license.

Let me know how that worked!
Regards
Kamil Musiałowski
Highcharts Developer
dperiyas
Posts: 12
Joined: Thu Feb 24, 2022 1:01 pm

Re: Export server not configured error

Hi,
Yes I had typed 'y' in the first question about the license. Also tried reinstall the export server even though got the same error while run curl command.
Are you sure that you have typed 'y' in the first question about the license? That a quite an easy mistake to do. Please reinstall the export server, run npm install again, and make sure to enter 'y' in the first question about the license.
As per the below reference we run the command multiple times after that also we got same issue.
viewtopic.php?f=9&t=48325
node node_modules\highcharts-export-server\build.js
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

Hi there,

We are investigating this issue. In the meantime, could you please tell me which Node.js version are you using, and did you try to install the export server on different Node versions?

Thank you for your patience.
Kamil Musiałowski
Highcharts Developer
dperiyas
Posts: 12
Joined: Thu Feb 24, 2022 1:01 pm

Re: Export server not configured error

Hi there,

We are investigating this issue. In the meantime, could you please tell me which Node.js version are you using, and did you try to install the export server on different Node versions?
Yes we tried installing export server with different Node versions.
Initially we used v12.19.0 node.js version while installing export server. We got the issue as I mentioned earlier.

And after that in some references they asked to try with latest node version so we updated the node.js version to v16.15.0. In this latest version also we got same issue.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

To get a better understanding of your issue, I would ask you to kindly answer the questions below:

1. Please give us a detailed explanation of how you install the dev server (do you install it as a dependency in your project or do you pull it from the GitHub repository or as a global package?)
2. Do you get the prompt with export server questions in any of these cases (when running node build, or during the installation)?
3. Have you tried any other methods aside from POST through curl? Please try to export a JSON file with your chart through CLI.
4. Have you ever used the export server? If yes, did it work and did you make any updates?

Thank you in advance,
Regards!
Kamil Musiałowski
Highcharts Developer
dperiyas
Posts: 12
Joined: Thu Feb 24, 2022 1:01 pm

Re: Export server not configured error

1. Please give us a detailed explanation of how you install the dev server (do you install it as a dependency in your project or do you pull it from the GitHub repository or as a global package?)
2. Do you get the prompt with export server questions in any of these cases (when running node build, or during the installation)?
3. Have you tried any other methods aside from POST through curl? Please try to export a JSON file with your chart through CLI.
4. Have you ever used the export server? If yes, did it work and did you make any updates?
1. Please give us a detailed explanation of how you install the dev server (do you install it as a dependency in your project or do you pull it from the GitHub repository or as a global package?)
We installed it as a global package in our angular project.
2. Do you get the prompt with export server questions in any of these cases (when running node build, or during the installation)?
Yes when running node build
3. Have you tried any other methods aside from POST through curl? Please try to export a JSON file with your chart through CLI.
We tried to export the module in our project but when export highcharts-export-server we are getting error in compile time itself.
4. Have you ever used the export server? If yes, did it work and did you make any updates?
We didnot used export server. This is the first time we are trying to use export server.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

1. I wouldn't suggest using a global packed inside a project. Instead, you can install the export server as a dependency and try to use it from there (as a node module).
A package should be installed globally when it provides an executable command that you run from the shell (CLI), and it's reused across projects.

In general, if you could explain to us how are you going to use the export server in your application - that would make it a bit easier for us to help you run it.

3. Try exporting a chart through CLI to see if the dev server is even configured properly.

GitHub instructions: https://github.com/highcharts/node-export-server

Regards!
Kamil Musiałowski
Highcharts Developer
dperiyas
Posts: 12
Joined: Thu Feb 24, 2022 1:01 pm

Re: Export server not configured error

Hi,
1. I wouldn't suggest using a global packed inside a project. Instead, you can install the export server as a dependency and try to use it from there (as a node module).
A package should be installed globally when it provides an executable command that you run from the shell (CLI), and it's reused across projects.

In general, if you could explain to us how are you going to use the export server in your application - that would make it a bit easier for us to help you run it.
Regards!
We are trying to use export server as a node module.(https://github.com/highcharts/node-expo ... ejs-module)

We had tried install export server as a module.
Like after install the export server as given in the ( https://github.com/highcharts/node-expo ... er#install )link
npm install highcharts-export-server -g

We tried to export the highcharts-export-module as in the below reference
https://github.com/highcharts/node-expo ... ejs-module
But when we add below export code we are not able to compile our application.
const exporter = require('highcharts-export-server');
While compiling we are getting error related to this export server module like some files are not found in module.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

Thank you for the quick reply!

Your issue seems to be quite simple. You are trying to reference a globally installed module (only by providing a module name in require method).

Please do the following:
Install the export server from your application by running inside it:

Code: Select all

npm i highcharts-export-server
It will be added as a dependency in your project. Then, find a relative path to your module (something like ./node_modules/highcharts-export-server), and run build on that (node ./node_modules/highcharts-export-server/build). In the prompt message, set everything that you need to 'y', and then you should be able to run it from your app.

I hope that now it will work in your project, so please let me know how this solution worked for you,
Good luck!
Kamil Musiałowski
Highcharts Developer
marcetera
Posts: 4
Joined: Fri Dec 30, 2022 4:21 am

Re: Export server not configured error

Hi
Im following the instructions provided in Install from here :

https://github.com/highcharts/node-export-server

Specifically , doing :

git clone https://github.com/highcharts/node-export-server
npm install
npm link

(
I also edited the environment variables , like so :
export ACCEPT_HIGHCHARTS_LICENSE=yes
export HIGHCHARTS_USE_STYLED=true
export HIGHCHARTS_USE_MAPS=true
export HIGHCHARTS_USE_GANTT=true
export HIGHCHARTS_MOMENT=true
export HIGHCHARTS_VERSION=latest
export HIGHCHARTS_CDN=https://code.highcharts.com/
)


My server is running and Im getting charts by using CURL in the terminal console , no problem there .

But, when Im trying to use node.js , as in the next example .

// /index.js

// 1. Import filesystem and Highcharts Export Server module
const fs = require("fs");
const chartExporter = require("highcharts-export-server");


// Initialize the exporter
chartExporter.initPool();
// Chart details object specifies chart type and data to plot

// Usually the same object that you use to configure your charts
// in the frontend. This will be used to specify the chart type
// and data to plot. I will use a bar chart, the same data
// specified in one of the official demonstrations in the HC website
let chartOptions = {
chart: {
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: Our Code World'
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Population (millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: ' millions'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 80,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
credits: {
enabled: false
},
series: [{
name: 'Year 1800',
data: [107, 31, 635, 203, 2]
}, {
name: 'Year 1900',
data: [133, 156, 947, 408, 6]
}, {
name: 'Year 2000',
data: [814, 841, 3714, 727, 31]
}, {
name: 'Year 2016',
data: [1216, 1001, 4436, 738, 40]
}]
};

// Export chart using these options
chartExporter.export({
type: "png",
options: chartOptions,
// By default the width of the chart images is of 600
// In this case, we want a big image
width: 1200
}, (err, res) => {
// Get the image data (base64)
let imageb64 = res.data;

// Filename of the output. In this case, we will write the image
// to the same directory of the initialization script.
let outputFile = "./output-chart.png";

// Save the image data to a file
fs.writeFileSync(outputFile, imageb64, "base64", function (err) {
if (err) console.log(err);
});

console.log("The chart has been succesfully generated!");

chartExporter.killPool();
});

Im getting the :

Export server not configured error

Im pretty lost . Please, could you help me to make that index.js example work ?


Im using this environment .

- node 16.17.0
- nvm
1.1.10

( I also tried with node 15.14.0 )


Thanks in advance !!.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Export server not configured error

Hi there,

Welcome to our forum and thank you for contacting us with your question.

I'd like to ask you to do the following things first, then we will see if that gave us any positive results.

Firstly, I don't see the export server version that you are using, but I'm assuming that it's not the latest one. We are currently in the process of replacing the old ES with the new 3.0.0 version. It is not on the master branch yet, but you can download it from this branch: https://github.com/highcharts/node-expo ... /puppeteer . I highly recommend using this over the previous version.

Once you go through the process of installing it, you should have the 3.0.0 version installed. Also, you can try to install it globally, just to be sure that it's accessible.

Secondly, once you do the first step - try to replicate te exact config and steps that are stated here https://github.com/highcharts/node-expo ... ejs-module

If you encounter any issues while doing that, or the problem still occurs - please let me know, we will have a deeper look into your issue.

Good luck!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Stock”