shlinkio / shlink-web-client

A React-based client application for Shlink
https://app.shlink.io
MIT License
299 stars 80 forks source link

crypto.randomUUID not found #1325

Closed phken91 closed 1 month ago

phken91 commented 1 month ago

shlink-web-client version

4.2.0

How do you use shlink-web-client

selfhosted with docker

Current behavior

fresh setup with docker, use without predefined server, and try to add server, then get this error in browser console. index-5ZKpCTif.js:735 TypeError: crypto.randomUUID is not a function

Expected behavior

add server without issues

Minimum steps to reproduce

part of my docker compose:

 shlink-admin:
    image: shlinkio/shlink-web-client
    environment:
      - VIRTUAL_HOST=host
      - LETSENCRYPT_HOST=host
acelaya commented 1 month ago

In v4.2 I replaced a dedicated dependency to generate UUIDs with the built in crypto.randomUUID() function, but I didn't realize it requires the app to run in a secure context (either using HTTPS, or be in localhost, 127.0.0.1 or similar. More info here if you are curious https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).

Even though I don't see why anyone would not use HTTPS these days, I understand we don't live in an ideal world, and this is going to bring me too many discussions to deal with (you are not the first one reporting it), so I'll roll this change back.