paralleldrive / cuid

Collision-resistant ids optimized for horizontal scaling and performance.
Other
3.42k stars 123 forks source link

Fails to work with cloudflare workers js runtime. #241

Closed GauravRajSharma closed 1 year ago

GauravRajSharma commented 2 years ago
var mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0; // exact line where error occurs

// ReferenceError: navigator is not defined 

ReferenceError while using cuid package within cloudflare workers. From my understanding, for the node version, it generates the fingerprint from process.pid but it is failing on me.

fergusmeiklejohn commented 2 years ago

Is there a way we can use the browser implementation in JS isolates?

hadri3n commented 1 year ago

Hello! Did anyone succeed to run it with Cloudflare Workers ?

ericelliott commented 1 year ago

I have a new implementation of cuid coming soon that will work in this context.

ericelliott commented 1 year ago

Fixed in Cuid2.