cosmos / cosmjs

The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.
https://cosmos.github.io/cosmjs/
Apache License 2.0
636 stars 324 forks source link

Module ctypto issue when vite build #1587

Open chunyang-infstones opened 1 month ago

chunyang-infstones commented 1 month ago

I'm using @cosmjs/stargate package on my website, a react project. When I run vite build command, I will get a warning as bellow:

[plugin:vite:resolve] [plugin vite:resolve] Module "crypto" has been externalized for browser compatibility, imported by "/Users/gechunyang/Documents/infstones/codes/dev-fte/webservice/webservice/client/node_modules/@cosmjs/crypto/build/random.js". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.

node_modules/@protobufjs/inquire/index.js (12:18): Use of eval in "node_modules/@protobufjs/inquire/index.js" is strongly discouraged as it poses security risks and may cause issues with minification.

This warning won't affect the functionality of my production, but I want to make sure that it won't cause any security issue or have other danger?