If I use 'rand' library anywhere before rendering, it renders nothing on the website
ydl1991 opened this issue · 2 comments
ydl1991 commented
anyone has tried this or knows why?
I tried to render some objects with random colors, and I created a vec of colors where I store the random color I generated using rng.gen_range() for rgb.
but if I try to render, it just shows white pages.
teymour-aldridge commented
You might need to configure some feature flags to get it to use builtin browser APIs rather than some other method which isn't supported by Wasm in the browser.
iyakushev commented
@ydl1991 Check out the console log in the browser. It will probably tell you that it had encountered a panic which is related to the thread_rng
or target is not supported
.
Specifing this feature in the TOML [dependencies]
section has helped me. Hope it helps.
rand = {version = "0.7.3", features = ['stdweb']}