randomUUID (utils/uuid.ts)

open-design · apps/web/src/utils/uuid.ts · typescript · Apache-2.0
integration

A robust UUID v4 generator that provides reliable ID generation even in non-secure browser contexts or environments without Web Crypto support.

// Source: https://github.com/nexu-io/open-design | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Tiered v4-UUID generator that survives non-secure contexts.
//
// `crypto.randomUUID()` is restricted to secure contexts — HTTPS or
// `localhost`. When OpenDesign is served over plain HTTP on a LAN
// IP (the standard Docker / unRAID / NAS self-hosted setup, e.g.
// `http://192.168.1.10:17573`), Chromium silently makes
// `crypto.randomUUID` undefined. Calls then throw
// `TypeError: crypto.randomUUID is not a function`, which the surrounding
// try/catch in `state/projects.ts` swallows — the Create button
// effectively becomes a no-op for every LAN-IP user (issue #849, also
// r

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key