randomUUID is not a function
Answered
gin posted this in #help-forum
ginOP
Yeah so idk why but randomUUID is somehow not recognized
3 Replies
ginOP
import {randomUUID} from "crypto";
useEffect(() => {
async function update() {
setSelfScribbleUser({
_id: self?._id || randomUUID(),
name: self?.profile.username || "Anonymous",
picture: self?.profile.social.display.picture.source || (await randomDog()),
});
}
update();
}, [self]);ive been using randomUUID for ages but now i get this error ->
TypeError: (0 , crypto__WEBPACK_IMPORTED_MODULE_4__.randomUUID) is not a functionginOP
ah found out it is only available under https context
Answer