-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Importing random
in Javascript causes a ReferenceError in Node
#16369
Comments
can't reproduce
node -v on osx. what is |
I am using Linux Mint 20 and have installed
|
Following your suggestion, I downloaded the most recent version of node (14.15.2) and the problem disappeared. Fantastic! It seems that the From my side, this issue can be closed. However, I expect that other Ubuntu/Mint users might stumble upon this problem. |
maybe this could be documented somehow |
Should I open a new issue, or is it better to reopen this? |
PR would be best |
Ok, but please give me an hint where to document this. My idea is to put the information in the page https://nim-lang.org/docs/backends.html#backends-the-javascript-target Would it be fine, or is there a better place where to place it? |
yes, there ( |
Importing
random
and exporting to a Javascript file produces a ReferenceError when ran by Node.Example
Current Output
Expected Output
Possible Solution
import random
solves the issue. However, in the script I am developing, I need to userandom
.Additional Information
This happens with both the
master
Nim branch and with release 1.4.2.I see there have been some issues with
random
+JS in the past (#12418, #11772, #9999), but they seem unrelated, as the error there was an overflow.The text was updated successfully, but these errors were encountered: