medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
24.92k stars 2.49k forks source link

cypto.getRandomValues() not supported. #4897

Closed Bludvikk closed 1 year ago

Bludvikk commented 1 year ago

Medusa Client. customers.create() Expo React Native Issue I was trying to implement a function where a user signs-up.

System information

Medusa version Latest: Node.js version: 18 Database: postgresql Operating system: Windows 11 Browser (if relevant):

Steps to reproduce the behavior

  1. Go to Account
  2. You will be prompted to sign-up or login.
  3. Input credentials, first_name, last_name, password, email
  4. LOGS. [Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported]

Expected behavior

It should redirect to the Home Screen where a session is created.

Screenshots

image image image

srindom commented 1 year ago

Is this error showing up in your server console or your frontend implementation console?

Bludvikk commented 1 year ago

In the server console, I use react hook form and the field values are good, it's just when calling the onSubmit.

Also, I tried to create a user using curl, it was successful, but still cannot login with medusa.auth.

Register and Signing in in the front-end does not work

Bludvikk commented 1 year ago

Figured it out myself, I just added

import "react-native-get-random-values" at the top of the file.

Bludvikk commented 1 year ago

using medusa auth on React Native requires you to import "react-native-get-random-values' at the top of the file.

This issue is resolved. GG