Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify NodeJs version in readme. #309

Open
P-eMartin opened this issue Nov 23, 2023 · 4 comments
Open

Specify NodeJs version in readme. #309

P-eMartin opened this issue Nov 23, 2023 · 4 comments

Comments

@P-eMartin
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants