leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.51k stars 371 forks source link

SyntaxError: Unexpected token (1935:31) #855

Closed ile closed 10 months ago

ile commented 10 months ago

When using require('uplot') in Node.js I'm getting this error:

SyntaxError: Unexpected token (1935:31)

It points here: https://github.com/leeoniya/uPlot/blob/master/dist/uPlot.cjs.js#L1967

(In my installed version the line seems to be 1935).

Maybe this isn't allowed: opts?.alignGaps?

ile commented 10 months ago

The reason seems to be package acorn, which is at version 7.4.1. I'll see if I can get it to update.

leeoniya commented 10 months ago

optional chaining has been supported by modern browsers since ~2020:

https://caniuse.com/mdn-javascript_operators_optional_chaining

ile commented 10 months ago

Yes. Browserify seems to be slow to update its dependencies.