所以我第一次使用 Prisma,我的提供商是mongodb
,当我想创建模型时,它向我抛出一个错误
Invalid `prisma.user.create()` invocation:
Prisma needs to perform transactions, which requires your MongoDB server to be run
as a replica set. https://pris.ly/d/mongodb-replica-set
Run Code Online (Sandbox Code Playgroud)
我在nextjs应用程序中使用 Prisma ,并将代码放在 API 页面内
我的 DATABASE_URL 是 mongodb://localhost:27017/threadzees
代码 :
Invalid `prisma.user.create()` invocation:
Prisma needs to perform transactions, which requires your MongoDB server to be run
as a replica set. https://pris.ly/d/mongodb-replica-set
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
因此,我目前正在为我正在构建的网站使用 tailwindcss,我想用自定义颜色制作一个小圆圈。现在我用了这个方法
<span className={`h-3 w-3 rounded-full bg-[#${role.color.toString(16)}]`} />
Run Code Online (Sandbox Code Playgroud)
基本上,role.color.toString(16)
返回一个十六进制代码。我已经检查过了,是的,它确实发送了有效的十六进制代码。现在当我查看该网站时,它没有添加颜色。有人知道这个问题的解决办法吗?