@clickhouse/client-web 在 Node.js v18+ 中出现的报错?-灵析社区

萌蒙萌

使用@clickhouse/client-web本地是正常的, 到测试环境就报错crypto.randomUUID is not a function ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241005/91452714d36318b8c0827dea06f3e13a.png) node版本18.多,依赖已安装上,搜索的方法也已经试过,没有效果,这是什么原因呢? ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241005/5d122a356fdd6a6f4014fb7aab2354f2.png)

阅读量:208

点赞量:0

问AI
"crypto.randomUUID" 需要项目域名开启 "https",本地使用 "localhost" 开发时会默认项目开启了 "https" 的所以可以用 "crypto.randomUUID" 这个方法。 如果测试环境的域名没有开启 "https" 的话,就会提示 "crypto.randomUUID is not a function",可以改用其他的 "uuid" 生成方式。