小编Jad*_*ulo的帖子

Prisma Mongodb 无法创建用户模型

所以我第一次使用 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)

我该如何解决这个问题?

mongodb next.js prisma

7
推荐指数
1
解决办法
8671
查看次数

自动滚动到 div 底部

所以目前我有这个问题,我正在反应 问题 GIF

我希望当页面加载时,它自动滚动到消息框的底部

这是我当前的代码:https ://sourceb.in/GU4IOYtB9H

typescript reactjs next.js

5
推荐指数
1
解决办法
1万
查看次数

TailwindCSS 自定义背景颜色不起作用

因此,我目前正在为我正在构建的网站使用 tailwindcss,我想用自定义颜色制作一个小圆圈。现在我用了这个方法

<span className={`h-3 w-3 rounded-full bg-[#${role.color.toString(16)}]`} />
Run Code Online (Sandbox Code Playgroud)

基本上,role.color.toString(16)返回一个十六进制代码。我已经检查过了,是的,它确实发送了有效的十六进制代码。现在当我查看该网站时,它没有添加颜色。有人知道这个问题的解决办法吗?

reactjs tailwind-css

1
推荐指数
1
解决办法
6698
查看次数

标签 统计

next.js ×2

reactjs ×2

mongodb ×1

prisma ×1

tailwind-css ×1

typescript ×1