adamgibbons / ics

iCalendar (ics) file generator for node.js
ISC License
715 stars 152 forks source link

crypto.randomBytes is not a function #193

Closed berenteb closed 2 years ago

berenteb commented 3 years ago

I am trying to use the createEvent function, and a TypeError showed up in the console breaking everything. If I comment out this part of the implementation, it goes away. I am using TypeScript.

buschco commented 3 years ago

If you are using react-native or similar environments that do no support the crypto API out of the box, try to install react-native-get-random-values polyfill and import it somewhere before this package import 'react-native-get-random-values';

For more info see here

adamgibbons commented 2 years ago

Should be resolved by switching from uuid to nano.