davidje13 / Refacto

A remote retro facilitation tool.
https://retro.davidje13.com/
GNU General Public License v3.0
23 stars 6 forks source link

Uncaught TypeError: crypto.randomUUID is not a function #32

Open jbjornson opened 11 months ago

jbjornson commented 11 months ago

I get the following error in the console when running refacto locally. The retro page loads, but as soon as I try to submit a comment or action, it generates this console error (no reaction in the browser).

259.65606303.js:2 Uncaught TypeError: crypto.randomUUID is not a function
    at i (index.5303f92b.js:1:441)
    at 74.0b2d8329.js:1:16895
    at index.5303f92b.js:1:12254
    at 74.0b2d8329.js:1:9136
    at 74.0b2d8329.js:1:5903
    at Object.De (259.65606303.js:2:27447)
    at He (259.65606303.js:2:27601)
    at 259.65606303.js:2:47462
    at Ir (259.65606303.js:2:47556)
    at jr (259.65606303.js:2:47970)
davidje13 commented 11 months ago

That API should be available in all recent browsers (anything updated since March 2022); which browser are you using? Do you have any special plugins or flags active?

Also are you connecting via localhost or are you trying to connect from another computer on the network? (browsers may disable parts of the crypto API if they don't think it's over a secure connection - http to localhost counts as secure, but http to a local IP address might not)

jbjornson commented 4 months ago

Also connecting via localhost on macos. I tried with latest versions of Chrome, Brave and Safari and all failed. I hacked the code to use uuid rather than node:crypto and it works without issues.

-import { randomUUID } from 'node:crypto';
+import { v4 as uuidv4 } from 'uuid';

with changes to the code like:

-    const id = randomUUID();
+    const id = uuidv4();
davidje13 commented 4 months ago

ah I misunderstood before; I thought you were seeing the error in the browser but I see you mean on the backend.

What version of NodeJS are you using? (node --version) Refacto is tested on 18, 20, 21, and 22. Older versions of NodeJS are unsupported.