Open DanielRuf opened 1 month ago
Ah I see now.
Renamed the customCode section of the options config to the customLogic in order to avoid confusion with the existing customCode property within.
After further checks it seems the documentation is outdated.
Instead of info.data
it should be info.result
.
After fixing that, it says Error: ENOENT: no such file or directory, open '...\public\resources.json'
.
This seems to come from https://github.com/highcharts/node-export-server/blob/master/lib/chart.js#L302-L331.
Hi @DanielRuf,
Thanks for reporting this as well. While I am indeed getting an error when trying to export the chart, it is related to another minor bug (which I will fix), and I cannot reproduce the error related to the resources.json
file. Could you provide me with a simple example where this issue is reproduced?
@PaulDalek when I have this config, I get the error:
customLogic: {
allowCodeExecution: true,
allowFileResources: false,
customCode: false,
callback: false,
resources: false,
loadConfig: false,
createConfig: false
},
When I use this, I do not get the resources.json
error:
customLogic: {
allowCodeExecution: true,
allowFileResources: false,
customCode: false,
callback: false,
resources: false,
loadConfig: false,
createConfig: false,
resources: ''
},
@DanielRuf Ok, I found it. I needed to change the allowCodeExecution
to true. The behavior is expected, as it looks for the default resources.json
file (just like in the older versions) and, if it doesn't find one, it throws an error which is handled and logs a warning with the error's stack. Other than that, the exporting process works as expected. I agree, though, that instead of displaying the stack, the warning log alone will suffice. I'll prepare a fix for that.
So far I have moved to the CLI where the issue does not exist with the same parameters. So I guess there is some inconsistence between the NodeJS module and the CLI regarding the handling of options / settings and parameters.
I'm getting the following error:
Cannot create property 'chart' on string '<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" class="highcharts-root
The config looks like this: