Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nickcopi opened this issue Sep 2, 2024 · 3 comments

Comments

@nickcopi
Copy link

nickcopi commented Sep 2, 2024

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):

  • OS: Windows 10
  • Browser Chrome
  • Version Chrome/127.0.6533.100

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
Copy link

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
Copy link
Author

nickcopi commented Oct 3, 2024

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants