You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I installed simplex-noise from npm and get the following error upon using it:
.../node_modules/simplex-noise/dist/cjs/simplex-noise.js:460
const r = i + ~~(random() * (256 - i));
^
TypeError: random is not a function
at buildPermutationTable (.../node_modules/simplex-noise/dist/cjs/simplex-noise.js:460:26)
at createNoise3D (.../node_modules/simplex-noise/dist/cjs/simplex-noise.js:164:18)
...
Node.js v18.9.1
I've removed my directories from the log.
I can't tell if this is an issue on my side (and I am missing the random function) or if this was supposed to be Math.random
Thanks!
The text was updated successfully, but these errors were encountered:
Random is passed in as an argument to buildPermutationTable so it shouldn't be Math.random. It is passed along from the random argument to createNoiseND where it defaults to Math.random.
If I had to guess you are doing something along the lines of createNoise3D('some string') instead of createNoise3D(someRandomFunction).
Can you show me how you are calling simplex-noise to get this error?
Not passing a parameter should not leave random undefined, it should fall back to Math.random. Can you share how you triggered this issue? I'd like to figure out what happenes there. :)
Hello, I installed
simplex-noise
from npm and get the following error upon using it:I've removed my directories from the log.
I can't tell if this is an issue on my side (and I am missing the
random
function) or if this was supposed to beMath.random
Thanks!
The text was updated successfully, but these errors were encountered: