highcharts / node-export-server

Highcharts Node.js export server
Other
356 stars 260 forks source link

v4: outdated example for Node.js module usage #563

Open DanielRuf opened 3 months ago

DanielRuf commented 3 months ago

The documentation says this: const exporter = require('highcharts-export-server');

But with the rest of the top-level awaits, we get this error:

SyntaxError: await is only valid in async functions and the top level bodies of modules

The whole code has to be wrappes as async IIFE.

PaulDalek commented 3 months ago

Hi @DanielRuf,

Thanks for reporting this. Due to the logic changes and other factors, many functions are now asynchronous. I'll update the example presented in the README.