Open P-eMartin opened 9 months ago
Since this is a web application, the code is running in the browser’s JavaScript runtime. Node is not involved here. Therefore, you should check caniuse: https://caniuse.com/?search=nullish%20coalescing
Bullish coalescing works in all browsers, except IE, which is fine, as this was replaced by Edge.
Well. I am not expert. Just noticed moving from 12 to 20 did the trick because of the Nullish Coalescing Operator: https://share.eva.mpg.de/index.php/s/bdoi3wzHdb26o99
Ah okay, a node package (the toastify component) was using that syntax. Indeed this was an node issue. Anyway, Node 16 is pretty old and it is end-of-life. I never developed this experiment with such an old version. When people install node, they usually get the latest LTS version. Is your distro shipping with such a legacy version?
Yes it is. Not sure why though. But was fast to fix once known. I would just suggest specifying min requirements to avoid other users to run in the same kind of error or modifying the syntax ;)
The Nullish Coalescing Operator is not supported in v12 for example (ES2020) could be replaced following the syntax below:
return answer == null ? 42 : answer;
same thanreturn answer ?? 42;