ccp-eva / matt

⛵️ Moral Attitudes Study
MIT License
0 stars 0 forks source link

Specify NodeJs version in readme. #309

Open P-eMartin opened 9 months ago

P-eMartin commented 9 months ago

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 than return answer ?? 42;

kalaschnik commented 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.

P-eMartin commented 9 months ago

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

kalaschnik commented 9 months ago

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?

P-eMartin commented 9 months ago

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 ;)