Error crypto with bcryptjs in react and vite app

55 views Asked by At

I use bcryptjs to hashe a value, all is working good but in the console browser i have this error:

Module "crypto" has been externalized for browser compatibility. Cannot access "crypto.randomBytes" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.

can i have a problem with that in deployment and even if it's not how i can fix it?

I tried to use vite-plugin-node-polyfills but without success or maybe that i used it wrong, i would like to use crypto-js but they say: Active development of CryptoJS has been discontinued. This library is no longer maintained...

So i don't know what to use, simple like crypto-js or bcrypt working good with browser?

0

There are 0 answers