Netflix / dispatch

All of the ad-hoc things you're doing to manage incidents today, done for you, and much more!
Apache License 2.0
5.02k stars 498 forks source link

"crypto.randomUUID is not a function" frontend error on latest Docker build when rendering UI components that use it #5155

Open nickcopi opened 1 month ago

nickcopi commented 1 month ago

Describe the bug I believe the Vue build is polyfilling crypto with a really old or weird polyfill that doesn't support randomUUID. This means code that expects this to exist (as it does in both modern node and modern browsers) errors.

To Reproduce Steps to reproduce the behavior:

  1. Go to /default/settings/projects/entity/types?project=default
  2. Open Chrome devtools
  3. See error "crypto.randomUUID is not a function"

Expected behavior The browser crypto should be used for modern browsers where it doesn't need to be polyfilled. This is breaking functionality of several UI components that I want to use, like the PlaygroundTextBox.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Additional context I'm not sure what is causing this. I tried rebuilding the docker image with a newer node version (18), but it seems like there are just so many layers of frontend magic here that I will defer to the experts.

BowlofCoolSauce commented 2 weeks ago

https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID It's only supposed to work in an HTTPS session. Since your screenshot shows unsecured mode then this is intended behavior.

nickcopi commented 2 weeks ago

https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID It's only supposed to work in an HTTPS session. Since your screenshot shows unsecured mode then this is intended behavior.

Ah, thanks, so the polyfill is behaving as intended. Might be nice for the application to handle cases where it isn't available gracefully instead of partially breaking the UI, but I am able to move forward with my usage of this application after throwing it behind an nginx server with a valid cert.

BowlofCoolSauce commented 2 weeks ago

Glad to hear that fixed it. As far as your suggestion, I'd recommend the other direction. Make it fail a health check and lock the UI to a loading screen telling you to deploy a cert. It's 2024 - port 80 is no longer supported just like ftp and tftp. They should be outright blocked on any network that remotely believes in the tiniest value of cyber security.